diff options
author | bobzel <zzzman@gmail.com> | 2022-06-08 01:45:05 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2022-06-08 01:45:05 -0400 |
commit | 7ab50d37d38a91d564cf3150be35a68d11bdcffe (patch) | |
tree | 659880ca188a7367ee2fdc377c2924b030dea720 | |
parent | f8840672a7bcb3f337d8e50098f374a1b2d441ce (diff) |
undo/redo fixes for docking views (maximizing, closing stacks). making maximised tabs persist across refreshes.
-rw-r--r-- | src/client/views/collections/CollectionDockingView.tsx | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx index 5af72b7d1..745565ff5 100644 --- a/src/client/views/collections/CollectionDockingView.tsx +++ b/src/client/views/collections/CollectionDockingView.tsx @@ -298,13 +298,6 @@ export class CollectionDockingView extends CollectionSubView() { this._goldenLayout.on('stackCreated', this.stackCreated); this._goldenLayout.registerComponent('DocumentFrameRenderer', TabDocView); this._goldenLayout.container = this._containerRef.current; - if (this._goldenLayout.config.maximisedItemId === '__glMaximised') { - try { - this._goldenLayout.config.root.getItemsById(this._goldenLayout.config.maximisedItemId)[0].toggleMaximise(); - } catch (e) { - this._goldenLayout.config.maximisedItemId = null; - } - } this._goldenLayout.init(); this._goldenLayout.root.layoutManager.on('itemDropped', this.tabItemDropped); this._goldenLayout.root.layoutManager.on('dragStart', this.tabDragStart); @@ -369,7 +362,7 @@ export class CollectionDockingView extends CollectionSubView() { const htmlTarget = e.target as HTMLElement; window.addEventListener("mouseup", this.onPointerUp); if (!htmlTarget.closest("*.lm_content") && (htmlTarget.closest("*.lm_tab") || htmlTarget.closest("*.lm_stack"))) { - if (htmlTarget.className !== "lm_close_tab") { + if (!htmlTarget.className.includes("lm_close") && !htmlTarget.className.includes("lm_maximise")) { this._flush = UndoManager.StartBatch("golden layout edit"); } } @@ -459,6 +452,9 @@ export class CollectionDockingView extends CollectionSubView() { alert('cant delete the last stack'); } })); + + stack.header?.controlsContainer.find('.lm_maximise') //get the close icon + .click(() => setTimeout(this.stateChanged)); stack.header?.controlsContainer.find('.lm_popout') //get the popout icon .off('click') //unbind the current click handler .click(action(() => { |