'use strict';

/**
 * Licensed Materials - Property of IBM
 * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2013, 2017
 * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
 *
 * VisActionHelper
 * The VisActionHelper is responsible for loading and executing interactive actions that affect the vismodel.
 *
 */

define(['../lib/@waca/core-client/js/core-client/ui/core/View', 'text!./templates/NextView.template'], function (View, NextViewTemplate) {

	var NextView = View.extend({

		events: {
			'primaryaction .viewCaption': '_goBack'
		},

		_previousView: null,
		_nextView: null,
		_title: null,

		init: function init(options) {
			NextView.inherited('init', this, arguments);

			this._previousView = options.previousView;
			this._nextView = options.nextView;
			this._title = options.title;
		},

		render: function render() {
			this.$el.html(NextViewTemplate);
			var contentContianer = this.$el.find('.content');

			contentContianer.append(this._nextView.$el);
			this._previousView.hide();

			this.$el.find('.viewCaption').append('<span class="wfg_leftarrow" tabindex=0></span>' + this._title);

			return this;
		},

		_goBack: function _goBack() {
			this.$el.empty();
			this._previousView.show();
		}

	});

	return NextView;
});
//# sourceMappingURL=NextView.js.map