VisActionSupportBase.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. 'use strict';
  2. /**
  3. * Licensed Materials - Property of IBM
  4. * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2018, 2019
  5. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  6. *
  7. * VisActionSupportBase
  8. * The VisActionSupportBase is the base for VisActionSupport classes
  9. *
  10. */
  11. define(['jquery', 'underscore', '../../lib/@waca/core-client/js/core-client/ui/core/Class'], function ($, _, Class) {
  12. 'use strict';
  13. var VisActionSupportBase = Class.extend({
  14. init: function init(params) {
  15. this.visAPI = params.visModel;
  16. this.pageContext = params.pageContext;
  17. this.ownerWidget = params.ownerWidget;
  18. this.logger = this.ownerWidget.logger;
  19. this.dashboard = params.ownerWidget.getDashboardApi();
  20. },
  21. _getFunction: function _getFunction(prefix, name) {
  22. var fname = prefix + name;
  23. return this[fname] ? this[fname].bind(this) : null;
  24. },
  25. _isWidgetOfType: function _isWidgetOfType(type) {
  26. return this.visAPI.getDefinition().id === type;
  27. }
  28. });
  29. return VisActionSupportBase;
  30. });
  31. //# sourceMappingURL=VisActionSupportBase.js.map