123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- /*
- IBM Confidential
- OCO Source Materials
- IBM Cognos Products: rs
- (C) Copyright IBM Corp. 2015, 2020
- The source code for this program is not published or otherwise divested of its trade secrets, irrespective of what has been deposited with the U.S. Copyright Office.
- */
- define(['bi/glass/app/plugins/ButtonActionInterface'], function(ButtonActionInterface) {
- 'use strict';
-
- var AuthoringButtonActionInterface = ButtonActionInterface.extend({
-
- onPress: function(context) {
-
- var v_sObserverId = 'rsAppButtonActions';
-
- console.log("rsAppButtonActions pressed");
- console.log('context.target.plugin.itemSpec.id: %s', context.target.plugin.itemSpec.id);
- var v_sId = context.target.plugin.itemSpec.id;
-
- var v_oContentView = context.glassContext.currentAppView.currentContentView;
- var v_Application = v_oContentView.getAuthoringApplication();
- if (!v_Application)
- {
- return;
- }
- // un-push / deselect any sibling buttons (temporary workaround till Glass will fix RTC 93965)
- // this doesn't work as expected, commenting out and waiting for Glass to implement API
- //context.target.plugin.$el.siblings('[type="button"]').removeClass('pushed');
- switch(v_sId)
- {
- case "com.ibm.bi.authoring.undoBtn":
- v_Application.SharedState.Call(v_sObserverId, "undo");
- break;
-
- case "com.ibm.bi.authoring.redoBtn":
- v_Application.SharedState.Call(v_sObserverId, "redo");
- break;
- case "com.ibm.bi.authoring.insertableObjectsBtn":
- v_Application.SharedState.Toggle(v_sObserverId, "showInsertableObjects");
- break;
- case "com.ibm.bi.authoring.toggleEditViewer":
- v_Application.ToggleBetweenEditViewModes(v_sObserverId);
- break;
-
- case "com.ibm.bi.authoring.refreshBtn":
- var v_oParameters = { Prompt : false };
- v_Application.SharedState.Call(null, "refresh", v_oParameters);
- break;
- case "com.ibm.bi.authoring.consumptionFilter":
- v_Application.SharedState.Toggle(v_sObserverId, "showFilters");
- break;
-
- default:
- console.log("Unhandled label: " + v_sId);
- return;
- }
- v_Application.GlassButton_onPress(v_sId);
- }
-
- });
- return AuthoringButtonActionInterface;
- });
|