123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- 'use strict';
- /*
- *+------------------------------------------------------------------------+
- *| Licensed Materials - Property of IBM
- *| IBM Cognos Products: Content Explorer
- *| (C) Copyright IBM Corp. 2019
- *|
- *| US Government Users Restricted Rights - Use, duplication or disclosure
- *| restricted by GSA ADP Schedule Contract with IBM Corp.
- *+------------------------------------------------------------------------+
- */
- define(['../../../lib/@waca/core-client/js/core-client/ui/core/Class'], function (Class) {
- var SlotEditorActionHandler = Class.extend({
- reload: function reload() {
- if (this.context && this.context.pushState) {
- // the slot editor is open.. refresh.
- this.openSlotEditor();
- }
- },
- onPress: function onPress(context) {
- this.context = context;
- if (!this.isRegisteredAsReloadable) {
- this.isRegisteredAsReloadable = true;
- context.glassContext.appController.getCurrentContentView().addReloadableObject('SlotEditorActionHandler', this);
- }
- if (context.pushState) {
- context.target.plugin.actionController = this;
- this.openSlotEditor(context);
- } else {
- this.onHide(context);
- }
- },
- onHide: function onHide(context) {
- var api = this._getDashboardApi(context);
- if (api) {
- api.toggleSlotEditor(false, context);
- }
- },
- openSlotEditor: function openSlotEditor(context) {
- var api = this._getDashboardApi(context);
- if (api) {
- api.toggleSlotEditor(true, context);
- }
- },
- _getDashboardApi: function _getDashboardApi(context) {
- if (!this._api && context && context.glassContext) {
- this._api = context.glassContext.appController.getCurrentContentView().getDashboardApi();
- }
- return this._api;
- }
- });
- return SlotEditorActionHandler;
- });
- //# sourceMappingURL=SlotEditorActionHandler.js.map
|