From e2c8ca0bf9e9f1c27d333b0b51ae3dd9d6cba05f Mon Sep 17 00:00:00 2001 From: Bob Zeleznik Date: Tue, 5 May 2020 13:33:26 -0400 Subject: fixed some interactions with WebDocuments --- src/client/views/DocumentButtonBar.tsx | 9 +++++++-- src/client/views/nodes/WebBox.scss | 4 ++-- src/client/views/nodes/WebBox.tsx | 26 +++++++++++--------------- 3 files changed, 20 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/client/views/DocumentButtonBar.tsx b/src/client/views/DocumentButtonBar.tsx index 3624cdb6d..7ba47deb5 100644 --- a/src/client/views/DocumentButtonBar.tsx +++ b/src/client/views/DocumentButtonBar.tsx @@ -22,6 +22,7 @@ import React = require("react"); import { DragManager } from '../util/DragManager'; import { MetadataEntryMenu } from './MetadataEntryMenu'; import GoogleAuthenticationManager from '../apis/GoogleAuthenticationManager'; +import { Docs } from '../documents/Documents'; const higflyout = require("@hig/flyout"); export const { anchorPoints } = higflyout; export const Flyout = higflyout.default; @@ -167,10 +168,14 @@ export class DocumentButtonBar extends React.Component<{ views: (DocumentView | return !targetDoc || !dataDoc || !dataDoc[GoogleRef] ? (null) :
e.altKey && runInAction(() => this.openHover = true)} + onPointerEnter={e => (e.altKey || e.shiftKey) && runInAction(() => this.openHover = true)} onPointerLeave={action(() => this.openHover = false)} onClick={e => { - if (e.altKey) { + if (e.shiftKey) { + e.preventDefault(); + CollectionDockingView.AddRightSplit(Docs.Create.WebDocument(`https://docs.google.com/document/d/${dataDoc[GoogleRef]}/edit`, + { _width: 600, _nativeWidth: 960, _nativeHeight: 800, isAnnotating: false })); + } else if (e.altKey) { e.preventDefault(); window.open(`https://docs.google.com/document/d/${dataDoc[GoogleRef]}/edit`); } else { diff --git a/src/client/views/nodes/WebBox.scss b/src/client/views/nodes/WebBox.scss index af84a7d95..4c05d4627 100644 --- a/src/client/views/nodes/WebBox.scss +++ b/src/client/views/nodes/WebBox.scss @@ -3,6 +3,8 @@ .webBox-container, .webBox-container-dragging { transform-origin: top left; + width: 100%; + height: 100%; .webBox-outerContent { width: 100%; height: 100%; @@ -66,8 +68,6 @@ opacity: 0.9; z-index: 9001; transition: top .5s; - padding: 10px; - .urlEditor { display: grid; diff --git a/src/client/views/nodes/WebBox.tsx b/src/client/views/nodes/WebBox.tsx index 4e383e468..80e15fd5f 100644 --- a/src/client/views/nodes/WebBox.tsx +++ b/src/client/views/nodes/WebBox.tsx @@ -51,7 +51,7 @@ export class WebBox extends ViewBoxAnnotatableComponent this.layoutDoc.scrollY, (scrollY) => { @@ -141,14 +141,13 @@ export class WebBox extends ViewBoxAnnotatableComponent
-
+
-
+
; } - const content = -
- {this.urlEditor()} - {view} -
; const decInteracting = DocumentDecorations.Instance?.Interacting; const frozen = !this.props.isSelected() || decInteracting; return (<> -
- {content} -
+
+ {view} +
; {!frozen ? (null) :
@@ -344,6 +339,7 @@ export class WebBox extends ViewBoxAnnotatableComponent
} + {this.urlEditor()} ); } scrollXf = () => this.props.ScreenToLocalTransform().translate(0, NumCast(this.props.Document.scrollTop)); @@ -351,8 +347,8 @@ export class WebBox extends ViewBoxAnnotatableComponent {this.content} -- cgit v1.2.3-70-g09d2