aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/DocumentView.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-05-10 14:05:01 -0400
committerbobzel <zzzman@gmail.com>2024-05-10 14:05:01 -0400
commit4b4d77f99bd55e6de0593c3acd1cf5798ae038bf (patch)
tree0fa27b0344c4252833b9d36dbe69f172141b846e /src/client/views/nodes/DocumentView.tsx
parente12f79e188c32787b5749eba54183002f270f998 (diff)
added an always option for OpenWhere lightbox. cleaned up/fixed making collections capable of being a lightbox.
Diffstat (limited to 'src/client/views/nodes/DocumentView.tsx')
-rw-r--r--src/client/views/nodes/DocumentView.tsx16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx
index 3e154aead..14feca0b5 100644
--- a/src/client/views/nodes/DocumentView.tsx
+++ b/src/client/views/nodes/DocumentView.tsx
@@ -151,12 +151,9 @@ export class DocumentViewInternal extends DocComponent<FieldViewProps & Document
@computed get disableClickScriptFunc() {
const onScriptDisable = this._props.onClickScriptDisable ?? this._componentView?.onClickScriptDisable?.() ?? this.layoutDoc.onClickScriptDisable;
- return (
- // eslint-disable-next-line no-use-before-define
- DocumentView.LongPress ||
- onScriptDisable === 'always' ||
- (onScriptDisable !== 'never' && (this.rootSelected() || this._componentView?.isAnyChildContentActive?.()))
- ); // prettier-ignore
+ return (DocumentView.LongPress ||
+ onScriptDisable === 'always' ||
+ (onScriptDisable !== 'never' && (this.rootSelected() || this._componentView?.isAnyChildContentActive?.()))); // prettier-ignore
}
@computed get _rootSelected() {
return this._props.isSelected() || BoolCast(this._props.TemplateDataDocument && this._props.rootSelected?.());
@@ -321,7 +318,7 @@ export class DocumentViewInternal extends DocComponent<FieldViewProps & Document
if (this.onDoubleClickHandler?.script) {
UndoManager.RunInBatch(() => this.onDoubleClickHandler.script.run(scriptProps, console.log).result?.select && this._props.select(false), 'on double click: ' + this.Document.title);
} else if (!Doc.IsSystem(this.Document) && defaultDblclick !== 'ignore') {
- UndoManager.RunInBatch(() => this._props.addDocTab(this.Document, OpenWhere.lightbox), 'double tap');
+ UndoManager.RunInBatch(() => this._props.addDocTab(this.Document, OpenWhere.lightboxAlways), 'double tap');
DocumentView.DeselectAll();
Doc.UnBrushDoc(this.Document);
} else {
@@ -334,12 +331,7 @@ export class DocumentViewInternal extends DocComponent<FieldViewProps & Document
let clickFunc: undefined | (() => any);
if (!this.disableClickScriptFunc && this.onClickHandler?.script) {
clickFunc = undoable(() => {
- // use this view's add doc func to override method for following links to undisplayed documents.
- // e.g., if this document is part of a labeled 'lightbox' container, then documents will be shown in this container of in the global lightbox
- const oldFunc = DocumentViewInternal.addDocTabFunc;
- DocumentViewInternal.addDocTabFunc = this._props.addDocTab;
this.onClickHandler?.script.run(scriptProps, console.log).result?.select && this._props.select(false);
- DocumentViewInternal.addDocTabFunc = oldFunc;
}, 'click ' + this.Document.title);
} else {
// onDragStart implies a button doc that we don't want to select when clicking. RootDocument & isTemplateForField implies we're clicking on part of a template instance and we want to select the whole template, not the part