aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/views/nodes/DocumentBox.tsx11
-rw-r--r--src/new_fields/Doc.ts1
2 files changed, 8 insertions, 4 deletions
diff --git a/src/client/views/nodes/DocumentBox.tsx b/src/client/views/nodes/DocumentBox.tsx
index bd239491b..978480142 100644
--- a/src/client/views/nodes/DocumentBox.tsx
+++ b/src/client/views/nodes/DocumentBox.tsx
@@ -76,13 +76,18 @@ export class DocumentBox extends DocAnnotatableComponent<FieldViewProps, DocBoxS
}
}
onPointerDown = (e: React.PointerEvent) => {
- if (e.button === 0 && !e.ctrlKey) {
+ if (this.active() && e.button === 0 && !e.ctrlKey) {
e.stopPropagation();
}
}
+ onLockClick = (e: React.MouseEvent) => {
+ this.toggleLockSelection();
+ (e.nativeEvent as any).formattedHandled = true;
+ e.stopPropagation();
+ }
onClick = (e: React.MouseEvent) => {
let hitWidget: boolean | undefined = false;
- if (this._contRef.current!.getBoundingClientRect().top + 15 > e.clientY) hitWidget = this.toggleLockSelection();
+ if (this._contRef.current!.getBoundingClientRect().top + 15 > e.clientY) hitWidget = (() => { this.props.select(false); return true; })();
else if (this._contRef.current!.getBoundingClientRect().bottom - 15 < e.clientY) hitWidget = (() => { this.props.select(false); return true; })();
else {
if (this._contRef.current!.getBoundingClientRect().left + 15 > e.clientX) hitWidget = this.prevSelection();
@@ -104,7 +109,7 @@ export class DocumentBox extends DocAnnotatableComponent<FieldViewProps, DocBoxS
onContextMenu={this.specificContextMenu}
onPointerDown={this.onPointerDown} onClick={this.onClick}
style={{ background: StrCast(this.props.Document.backgroundColor) }}>
- <div className="documentBox-lock">
+ <div className="documentBox-lock" onClick={this.onLockClick}>
<FontAwesomeIcon icon={this.isSelectionLocked() ? "lock" : "unlock"} size="sm" />
</div>
{!(containedDoc instanceof Doc) ? (null) : <ContentFittingDocumentView
diff --git a/src/new_fields/Doc.ts b/src/new_fields/Doc.ts
index 81e32484c..4a6ff8e42 100644
--- a/src/new_fields/Doc.ts
+++ b/src/new_fields/Doc.ts
@@ -481,7 +481,6 @@ export namespace Doc {
setTimeout(action(() => {
if (!targetDoc[expandedLayoutFieldKey]) {
const newLayoutDoc = Doc.MakeDelegate(templateLayoutDoc, undefined, "[" + templateLayoutDoc.title + "]");
- newLayoutDoc.lockedPosition = true;
newLayoutDoc.expandedTemplate = targetDoc;
targetDoc[expandedLayoutFieldKey] = newLayoutDoc;
const dataDoc = Doc.GetProto(targetDoc);