diff options
| author | bobzel <zzzman@gmail.com> | 2019-01-31 19:37:49 -0500 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2019-01-31 19:37:49 -0500 |
| commit | b2c95923e631bc4acae8bb3d10913704d8ec9939 (patch) | |
| tree | 33d0afa3aa149dac19ed7b8bdc67833100e44f05 /src/views/collections | |
| parent | 772af9c62ff6e96747c94190cae5f0b2a94d3485 (diff) | |
added full screen toggle
Diffstat (limited to 'src/views/collections')
| -rw-r--r-- | src/views/collections/CollectionDockingView.tsx | 25 | ||||
| -rw-r--r-- | src/views/collections/CollectionFreeFormView.tsx | 2 |
2 files changed, 25 insertions, 2 deletions
diff --git a/src/views/collections/CollectionDockingView.tsx b/src/views/collections/CollectionDockingView.tsx index 8c822fba4..d4965645c 100644 --- a/src/views/collections/CollectionDockingView.tsx +++ b/src/views/collections/CollectionDockingView.tsx @@ -165,6 +165,24 @@ export class CollectionDockingView extends React.Component<CollectionViewProps> // all of this must be undone when the document has been dropped (see tabCreated) } + + _makeFullScreen: boolean = false; + _maximizedStack: any = null; + public static OpenFullScreen(dv: DocumentView) { + var newItemConfig = { + type: 'component', + componentName: 'documentViewComponent', + componentState: { doc: dv.props.Document } + }; + CollectionDockingView.myLayout._makeFullScreen = true; + CollectionDockingView.myLayout.root.contentItems[ 0 ].addChild(newItemConfig); + } + public static CloseFullScreen() { + if (CollectionDockingView.myLayout._maximizedStack != null) { + CollectionDockingView.myLayout._maximizedStack.header.controlsContainer.find('.lm_close').click(); + CollectionDockingView.myLayout._maximizedStack = null; + } + } goldenLayoutFactory() { CollectionDockingView.myLayout = this.modelForGoldenLayout; @@ -186,6 +204,10 @@ export class CollectionDockingView extends React.Component<CollectionViewProps> }); CollectionDockingView.myLayout.on('stackCreated', function (stack: any) { + if (CollectionDockingView.myLayout._makeFullScreen) { + CollectionDockingView.myLayout._maximizedStack = stack; + CollectionDockingView.myLayout._maxstack = stack.header.controlsContainer.find('.lm_maximise'); + } stack.header.controlsContainer.find('.lm_popout').hide(); stack.header.controlsContainer.find('.lm_close') //get the close icon .off('click') //unbind the current click handler @@ -210,6 +232,9 @@ export class CollectionDockingView extends React.Component<CollectionViewProps> ), document.getElementById(containingDiv) ); + if (CollectionDockingView.myLayout._maxstack != null) { + CollectionDockingView.myLayout._maxstack.click(); + } }, 0); }); CollectionDockingView.myLayout.container = this._containerRef.current; diff --git a/src/views/collections/CollectionFreeFormView.tsx b/src/views/collections/CollectionFreeFormView.tsx index b118f7ac8..39a8fc44f 100644 --- a/src/views/collections/CollectionFreeFormView.tsx +++ b/src/views/collections/CollectionFreeFormView.tsx @@ -70,8 +70,6 @@ export class CollectionFreeFormView extends React.Component<CollectionViewProps> @action onPointerDown = (e: React.PointerEvent): void => { if (e.button === 2 && this.active) { - e.stopPropagation(); - e.preventDefault(); document.removeEventListener("pointermove", this.onPointerMove); document.addEventListener("pointermove", this.onPointerMove); document.removeEventListener("pointerup", this.onPointerUp); |
