VisTooltipInfo.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. 'use strict';
  2. /**
  3. * Licensed Materials - Property of IBM
  4. * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2018
  5. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  6. */
  7. define(['underscore', './VisSelectionInfo'], function (_, Class) {
  8. 'use strict';
  9. var VisTooltipInfo = Class.extend({
  10. init: function init() {
  11. VisTooltipInfo.inherited('init', this, arguments);
  12. this._aCustomSelections = [];
  13. },
  14. addCustomSelection: function addCustomSelection(label, value) {
  15. this._aCustomSelections.push({
  16. name: label,
  17. value: value
  18. });
  19. },
  20. getCustomLabelSelections: function getCustomLabelSelections() {
  21. return _.filter(this._aCustomSelections, function (selection) {
  22. return 'name' in selection && selection.name;
  23. });
  24. },
  25. getCustomTitleSelections: function getCustomTitleSelections() {
  26. return _.filter(this._aCustomSelections, function (selection) {
  27. return !('name' in selection) || !selection.name;
  28. });
  29. }
  30. });
  31. return VisTooltipInfo;
  32. });
  33. //# sourceMappingURL=VisTooltipInfo.js.map