CustomTooltip.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. 'use strict';
  2. /**
  3. * Licensed Materials - Property of IBM
  4. * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2014, 2020
  5. * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  6. */
  7. define(['../lib/@waca/core-client/js/core-client/ui/core/View', 'react-dom', 'react'], function (View, ReactDOM, React) {
  8. // The custom Content uses the react rendere extension, but it is used in the old tooltip which is jquery based
  9. // This class will bridge the 2 technologies
  10. var CustomContent = View.extend({
  11. init: function init(tooltipContentRenderer, options) {
  12. CustomContent.inherited('init', this, arguments);
  13. this.tooltipContentRenderer = tooltipContentRenderer;
  14. this.options = options;
  15. },
  16. render: function render() {
  17. try {
  18. var components = this.tooltipContentRenderer.getComponentList(this.options);
  19. ReactDOM.render(React.createElement(
  20. 'div',
  21. { className: 'tooltipContainer' },
  22. components
  23. ), this.$el[0]);
  24. } catch (e) {
  25. this.$el.append(e.toString());
  26. }
  27. }
  28. });
  29. return CustomContent;
  30. });
  31. //# sourceMappingURL=CustomTooltip.js.map