import bundleService from "./bundle.js"; import ws from "./ws.js"; import optionsService from "./options.js"; const $sidebar = $("#right-pane"); const $sidebarContainer = $sidebar.find('.sidebar-container'); const $showSideBarButton = $sidebar.find(".show-sidebar-button"); const $hideSidebarButton = $sidebar.find(".hide-sidebar-button"); $hideSidebarButton.on('click', () => { $sidebar.hide(); $showSideBarButton.show(); }); // FIXME shoud run note loaded! $showSideBarButton.on('click', () => { $sidebar.show(); $showSideBarButton.hide(); }); class Sidebar { /** * @param {TabContext} ctx * @param {object} state */ constructor(ctx, state = {}) { /** @property {TabContext} */ this.ctx = ctx; this.state = Object.assign({ widgets: [] }, state); this.widgets = []; this.$widgetContainer = $sidebar.find(`.sidebar-widget-container[data-tab-id=${this.ctx.tabId}]`); if (this.$widgetContainer.length === 0) { this.$widgetContainer = $(`