SubscriptionManagementButtonView.js 1018 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Licensed Materials - Property of IBM
  3. *
  4. * IBM Cognos Products: SHARE
  5. *
  6. * (C) Copyright IBM Corp. 2015
  7. *
  8. * US Government Users Restricted Rights - Use, duplication or disclosure
  9. * restricted by GSA ADP Schedule Contract with IBM Corp.
  10. */
  11. define(['bi/glass/app/plugins/MenuActionInterface', 'bi/sharecommon/utils/translator',
  12. 'bi/schedule/app/appControler'], function(view, t, controler) {
  13. 'use strict';
  14. var SubscriptionButtonView = view.extend({
  15. onSelectItem: function(context) {
  16. var id = context.target.itemId;
  17. var idTokens = id.split('.');
  18. var key = idTokens[idTokens.length-1];
  19. if (key === "subscribe_mgmt") {
  20. controler.showSubscriptionManagementPane(context.glassContext);
  21. }
  22. },
  23. isItemVisible: function(context) {
  24. var id = context.target.itemId;
  25. var idTokens = id.split('.');
  26. var key = idTokens[idTokens.length-1];
  27. if (key === "subscribe_mgmt") {
  28. return true;
  29. }
  30. else {
  31. return false;
  32. }
  33. }
  34. });
  35. return SubscriptionButtonView;
  36. });