Tooltip.js 784 B

123456789101112131415161718192021
  1. var INSPECTOR;
  2. (function (INSPECTOR) {
  3. /**
  4. * Creates a tooltip for the given html element
  5. */
  6. var Tooltip = (function () {
  7. function Tooltip(elem, tip) {
  8. var _this = this;
  9. this._elem = elem;
  10. this._infoDiv = INSPECTOR.Helpers.CreateDiv('tooltip', this._elem);
  11. this._elem.addEventListener('mouseover', function () {
  12. _this._infoDiv.textContent = tip;
  13. _this._infoDiv.style.display = 'block';
  14. });
  15. this._elem.addEventListener('mouseout', function () { _this._infoDiv.style.display = 'none'; });
  16. }
  17. return Tooltip;
  18. }());
  19. INSPECTOR.Tooltip = Tooltip;
  20. })(INSPECTOR || (INSPECTOR = {}));
  21. //# sourceMappingURL=Tooltip.js.map