You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

34 lines
547 B

  1. define([
  2. 'html!./template',
  3. 'css!./styles'
  4. ], function (
  5. template,
  6. styles
  7. ) {
  8. return {
  9. tpl: template,
  10. postRender: function () {
  11. this.onEvent('onShowTooltip', this.events.onShowTooltip.bind(this));
  12. this.onEvent('onHideTooltip', this.events.onHideTooltip.bind(this));
  13. },
  14. events: {
  15. onShowTooltip: function (mouse, text) {
  16. this.show();
  17. this.el.html(text);
  18. this.el.css({
  19. left: mouse.raw.clientX + 20,
  20. top: mouse.raw.clientY
  21. });
  22. },
  23. onHideTooltip: function () {
  24. this.hide();
  25. }
  26. }
  27. }
  28. });