ContextMenuReactAdapter.js 994 B

12345678910111213141516171819202122232425262728293031323334
  1. "use strict";
  2. /**
  3. * Licensed Materials - Property of IBM
  4. * IBM Cognos Products: Cognos Analytics
  5. * Copyright IBM Corp. 2020
  6. * US Government Users Restricted Rights - Use, duplication or disclosure
  7. * restricted by GSA ADP Schedule Contract with IBM Corp.
  8. */
  9. define(['bi/commons/ui/core/Class', 'ba-react-admin/ba-react-admin.min'], function (Class, AdminReact) {
  10. 'use strict'; //NOSONAR: meant to be strict
  11. var ContextMenuController = Class.extend({
  12. acmAdapter: null,
  13. init: function init() {
  14. this.acmAdapter = new AdminReact.AccountsContextMenuAdapter();
  15. },
  16. /**
  17. * Called by glass for each menu item to know if it's visible or not
  18. */
  19. isItemVisible: function isItemVisible(context) {
  20. return this.acmAdapter.isItemVisible(context);
  21. },
  22. /**
  23. * Called when the menu item is pressed
  24. */
  25. onSelectItem: function onSelectItem(context) {
  26. this.acmAdapter.onSelectItem(context);
  27. }
  28. });
  29. return ContextMenuController;
  30. });