1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- /*
- * Licensed Materials - Property of IBM
- *
- * IBM Cognos Products: SHARE
- *
- * (C) Copyright IBM Corp. 2015
- *
- * US Government Users Restricted Rights - Use, duplication or disclosure
- * restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define(['bi/glass/app/plugins/MenuActionInterface', 'bi/commons/utils/Utils'], function(view, utils) {
- 'use strict';
- var legacyAppButtonView = view.extend({
- onSelectItem: function(context) {
- var index = context.target.specItemIndex;
- var item = context.target.plugin.itemSpec.items[index];
-
- if (item.tool) {
- utils.legacyLaunch(context.glassContext, item.tool);
- }
- },
-
- isItemVisible: function(context) {
- var id = context.target.itemId;
- var idTokens = id.split('.');
- var key = idTokens[idTokens.length-1];
- if (key === "legacy_myInbox" || key === "legacy_myWatchItems") {
- return this._getIsLaunchable();
- }
- else {
- return false;
- }
- },
-
- onRender: function(context) {
- context.glassContext.services.config.getLegacyLaunchable().done(function(value) {
- this._setIsLaunchable(value === 1);
- }.bind(this))
- },
-
- _setIsLaunchable: function(value) {
- this.isLaunchable = value;
- },
-
- _getIsLaunchable: function() {
- return this.isLaunchable;
- }
- });
- return legacyAppButtonView;
- });
|