Nessuna descrizione

Toolbar.js 1.3KB

12345678910111213141516171819202122232425262728293031323334
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var ToolbarButton_1 = require("./ToolbarButton");
  4. var uuid_1 = require("../utils/uuid");
  5. var Toolbar = (function () {
  6. function Toolbar(toolbarItems, clickHandler) {
  7. var _this = this;
  8. this.id = uuid_1.uuid();
  9. this.getUI = function () {
  10. _this.toolbarUI = document.createElement('div');
  11. _this.toolbarUI.id = "fcw-toolbar-" + _this.id;
  12. _this.toolbarUI.className = 'fc-whiteboard-toolbar';
  13. for (var _i = 0, _a = _this.toolbarItems; _i < _a.length; _i++) {
  14. var toolbarItem = _a[_i];
  15. var toolbarButton = new ToolbarButton_1.ToolbarButton(toolbarItem, _this.clickHandler);
  16. _this.toolbarUI.appendChild(toolbarButton.getElement());
  17. }
  18. return _this.toolbarUI;
  19. };
  20. this.toolbarItems = toolbarItems;
  21. this.clickHandler = clickHandler;
  22. }
  23. Toolbar.prototype.hide = function () {
  24. this.toolbarUI.style.visibility = 'hidden';
  25. this.toolbarUI.style.zIndex = '-1';
  26. };
  27. Toolbar.prototype.show = function () {
  28. this.toolbarUI.style.visibility = 'visible';
  29. this.toolbarUI.style.zIndex = '999';
  30. };
  31. return Toolbar;
  32. }());
  33. exports.Toolbar = Toolbar;