12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- 'use strict';
- /*
- *+------------------------------------------------------------------------+
- *| Licensed Materials - Property of IBM
- *| IBM Cognos Products: Content Explorer
- *| (C) Copyright IBM Corp. 2016, 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', '../../../lib/@waca/core-client/js/core-client/utils/ClassFactory'], function (Class, ClassFactory) {
- var Action = Class.extend({
- /**
- * if necessary set visibility on condition,
- * extra options parameter can be passed in
- */
- isItemVisible: function isItemVisible() {
- return true;
- },
- /**
- * Callback when select a context menu item
- *
- * @param context {object}
- **/
- onSelectItem: function onSelectItem(context) {
- var promise;
- var oTarget = context.target;
- switch (oTarget.itemId) {
- case 'com.ibm.bi.dashboard.relinkDataset':
- var oActiveObject = oTarget.activeObject;
- if (oActiveObject) {
- promise = ClassFactory.loadModule(oActiveObject.dialogModule).then(function (OpenDialog) {
- var openDialog = new OpenDialog({
- 'glassContext': context.glassContext,
- 'dataset': oActiveObject.dataset
- });
- openDialog.open();
- return openDialog;
- });
- } else {
- promise = Promise.resolve();
- }
- break;
- default:
- promise = Promise.resolve();
- break;
- }
- return promise;
- }
- });
- return Action;
- });
- //# sourceMappingURL=DSContextMenuActionHandler.js.map
|