DoMoreActionHandler.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. 'use strict';
  2. /*
  3. *+------------------------------------------------------------------------+
  4. *| Licensed Materials - Property of IBM
  5. *| IBM Cognos Products: CA
  6. *| (C) Copyright IBM Corp. 2017 - 2018
  7. *| US Government Users Restricted Rights - Use, duplication or disclosure
  8. *| restricted by GSA ADP Schedule Contract with IBM Corp.
  9. *+------------------------------------------------------------------------+
  10. */
  11. define(['../../lib/@waca/core-client/js/core-client/ui/core/Class', './MenuActionHelper'], function (BaseClass, MenuActionHelper) {
  12. 'use strict';
  13. var DoMoreActionHandler = BaseClass.extend({
  14. init: function init(options) {
  15. DoMoreActionHandler.inherited('init', this, arguments);
  16. this.dashboardApi = options.dashboardApi;
  17. this.dataSourcePanel = options.dataSourcePanel;
  18. },
  19. /**
  20. * Do More button event handler. Called when the Do More button is clicked or tapped.
  21. */
  22. execute: function execute(evt) {
  23. var metadataView = this.dataSourcePanel.currentView;
  24. MenuActionHelper.getActionPayload({
  25. 'dashboardApi': this.dashboardApi,
  26. 'id': metadataView.dataSource.getAssetId(),
  27. 'type': metadataView.dataSource.getType(),
  28. 'event': evt,
  29. 'menuId': 'com.ibm.bi.dashboard.dataSources.dataSourceActionsMenu'
  30. }).then(function (payload) {
  31. payload.activeObject.parentSlideout = metadataView;
  32. payload.activeObject.dataSource = metadataView.dataSource;
  33. this.dashboardApi.showContextMenu(payload);
  34. }.bind(this));
  35. return false;
  36. }
  37. });
  38. return DoMoreActionHandler;
  39. });
  40. //# sourceMappingURL=DoMoreActionHandler.js.map