NextView.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. 'use strict';
  2. /**
  3. * Licensed Materials - Property of IBM
  4. * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2013, 2019
  5. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  6. *
  7. * VisActionHelper
  8. * The VisActionHelper is responsible for loading and executing interactive actions that affect the vismodel.
  9. *
  10. */
  11. define(['../../../lib/@waca/core-client/js/core-client/ui/core/View', 'text!./templates/NextView.html'], function (View, NextViewTemplate) {
  12. var NextView = View.extend({
  13. events: {
  14. 'primaryaction .viewCaption': '_goBack'
  15. },
  16. _previousView: null,
  17. _nextView: null,
  18. _title: null,
  19. init: function init(options) {
  20. NextView.inherited('init', this, arguments);
  21. this._previousView = options.previousView;
  22. this._nextView = options.nextView;
  23. this._title = options.title;
  24. },
  25. render: function render() {
  26. this.$el.html(NextViewTemplate);
  27. var contentContianer = this.$el.find('.content');
  28. contentContianer.append(this._nextView.$el);
  29. this._previousView.hide();
  30. this.$el.find('.viewCaption').append('<span class="wfg_leftarrow" tabindex=0></span>' + this._title);
  31. return this;
  32. },
  33. _goBack: function _goBack() {
  34. this.$el.empty();
  35. this._previousView.show();
  36. }
  37. });
  38. return NextView;
  39. });
  40. //# sourceMappingURL=NextView.js.map