12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- "use strict";
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: Cognos Analytics
- * Copyright IBM Corp. 2015, 2016
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define(['underscore', 'q', 'bi/admin/nls/StringResource', 'bi/commons/ui/View', 'bi/commons/ui/StandardLayoutView', 'bi/admin/account/slideout/features/FeaturesHeader', 'bi/admin/account/slideout/features/FeaturesBody', 'bi/admin/account/slideout/features/FeaturesFooter'], function (_, Q, StringResource, View, StandardLayoutView, FeaturesHeader, FeaturesBody, FeaturesFooter) {
- 'use strict'; //NOSONAR
- var FeaturesPane = View.extend({
- init: function init(options) {
- FeaturesPane.inherited('init', this, arguments);
- _.extend(this, options);
- this._standardLayoutView = new StandardLayoutView();
- this._standardLayoutView.headerView = this._createHeader();
- this._standardLayoutView.footerView = this._createFooter();
- this._body = this._createBody();
- this._body.$el = this._standardLayoutView.$standardBody;
- this._standardLayoutView.bodyView = this._body;
- this.$el = this._standardLayoutView.$el;
- },
- _createHeader: function _createHeader() {
- return new FeaturesHeader({
- 'onFilter': this.filter.bind(this)
- });
- },
- _createFooter: function _createFooter() {
- return new FeaturesFooter({
- 'onReset': this.reset.bind(this),
- 'onApply': this.onApply ? this.onApply.bind(this) : null,
- 'isCustomized': this.isCustomized
- });
- },
- setFocus: function setFocus() {
- this.$el.find(".standardHeader .propertyUIControl").focus();
- },
- _createBody: function _createBody() {
- return new FeaturesBody({
- 'glassContext': this.glassContext,
- 'slideout': this.slideout,
- 'objectInfo': this.objectInfo,
- 'onChange': function (featureId, checked) {
- this._standardLayoutView.footerView.setModified(true);
- if (this.onChange) {
- this.onChange(featureId, checked);
- }
- }.bind(this),
- 'getPerspectives': this.getPerspectives ? this.getPerspectives.bind(this) : null,
- 'getExcludeList': this.getExcludeList ? this.getExcludeList.bind(this) : null
- });
- },
- remove: function remove() {
- this._standardLayoutView.remove();
- },
- reset: function reset() {
- this._body.reset();
- if (this.onReset) {
- this.onReset();
- if (this.getExcludeList().ids.length === 0) {
- this._standardLayoutView.footerView.setModified(false);
- }
- }
- },
- render: function render() {
- return this._standardLayoutView.render();
- },
- filter: function filter(value) {
- this._body.filter(value);
- }
- });
- return FeaturesPane;
- });
|