abstract_entry.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. "use strict";
  2. var __extends = (this && this.__extends) || (function () {
  3. var extendStatics = function (d, b) {
  4. extendStatics = Object.setPrototypeOf ||
  5. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  6. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  7. return extendStatics(d, b);
  8. };
  9. return function (d, b) {
  10. extendStatics(d, b);
  11. function __() { this.constructor = d; }
  12. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  13. };
  14. })();
  15. Object.defineProperty(exports, "__esModule", { value: true });
  16. exports.AbstractEntry = void 0;
  17. var menu_element_js_1 = require("./menu_element.js");
  18. var html_classes_js_1 = require("./html_classes.js");
  19. var AbstractEntry = (function (_super) {
  20. __extends(AbstractEntry, _super);
  21. function AbstractEntry(_menu, _type) {
  22. var _this = _super.call(this) || this;
  23. _this._menu = _menu;
  24. _this._type = _type;
  25. _this.className = html_classes_js_1.HtmlClasses['MENUITEM'];
  26. _this.role = 'menuitem';
  27. _this.hidden = false;
  28. return _this;
  29. }
  30. Object.defineProperty(AbstractEntry.prototype, "menu", {
  31. get: function () {
  32. return this._menu;
  33. },
  34. set: function (menu) {
  35. this._menu = menu;
  36. },
  37. enumerable: false,
  38. configurable: true
  39. });
  40. Object.defineProperty(AbstractEntry.prototype, "type", {
  41. get: function () {
  42. return this._type;
  43. },
  44. enumerable: false,
  45. configurable: true
  46. });
  47. AbstractEntry.prototype.hide = function () {
  48. this.hidden = true;
  49. this.menu.generateMenu();
  50. };
  51. AbstractEntry.prototype.show = function () {
  52. this.hidden = false;
  53. this.menu.generateMenu();
  54. };
  55. AbstractEntry.prototype.isHidden = function () {
  56. return this.hidden;
  57. };
  58. return AbstractEntry;
  59. }(menu_element_js_1.MenuElement));
  60. exports.AbstractEntry = AbstractEntry;
  61. //# sourceMappingURL=abstract_entry.js.map