AbstractTreeTool.js 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. var INSPECTOR;
  2. (function (INSPECTOR) {
  3. var AbstractTreeTool = (function () {
  4. function AbstractTreeTool() {
  5. /** Is the tool enabled ? */
  6. this._on = false;
  7. this._elem = INSPECTOR.Inspector.DOCUMENT.createElement('i');
  8. this._elem.className = 'treeTool fa';
  9. this._addEvents();
  10. }
  11. AbstractTreeTool.prototype.toHtml = function () {
  12. return this._elem;
  13. };
  14. AbstractTreeTool.prototype._addEvents = function () {
  15. var _this = this;
  16. this._elem.addEventListener('click', function (e) {
  17. _this.action();
  18. e.stopPropagation();
  19. });
  20. };
  21. /**
  22. * Action launched when clicked on this element
  23. * Should be overrided
  24. */
  25. AbstractTreeTool.prototype.action = function () {
  26. this._on = !this._on;
  27. };
  28. return AbstractTreeTool;
  29. }());
  30. INSPECTOR.AbstractTreeTool = AbstractTreeTool;
  31. })(INSPECTOR || (INSPECTOR = {}));
  32. //# sourceMappingURL=AbstractTreeTool.js.map