aboutsummaryrefslogtreecommitdiff
path: root/src/views/collections
diff options
context:
space:
mode:
Diffstat (limited to 'src/views/collections')
-rw-r--r--src/views/collections/CollectionDockingView.tsx25
-rw-r--r--src/views/collections/CollectionFreeFormView.tsx2
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);