123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- 'use strict';
- /*
- *+------------------------------------------------------------------------+
- *| Licensed Materials - Property of IBM
- *| IBM Cognos Products: Content Explorer
- *| (C) Copyright IBM Corp. 2016, 2017
- *|
- *| US Government Users Restricted Rights - Use, duplication or disclosure
- *| restricted by GSA ADP Schedule Contract with IBM Corp.
- *+------------------------------------------------------------------------+
- */
- define(['../../lib/@waca/baglass/js/baglass/app/plugins/Button'], function (BaseClass) {
- var UndoRedoButton = BaseClass.extend({
- /**
- * Method to determine whether the button can be enabled or not
- */
- canEnable: function canEnable() /*controller*/{
- return true;
- },
- onRender: function onRender(context) {
- this._toggleState(context.target.plugin);
- },
- onStateChange: function onStateChange(controller) {
- this._toggleState(this, controller);
- },
- _toggleState: function _toggleState(plugin, controller) {
- if (plugin) {
- if (controller && this.canEnable(controller)) {
- plugin.enable();
- } else {
- plugin.disable();
- }
- }
- }
- });
- return UndoRedoButton;
- });
- //# sourceMappingURL=UndoRedoButton.js.map
|