aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/DocumentDecorations.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/DocumentDecorations.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/DocumentDecorations.tsx')
-rw-r--r--src/client/views/DocumentDecorations.tsx16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index fd44909c0..93c3e3338 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -32,7 +32,7 @@ import { Colors } from './global/globalEnums';
import { CollectionFreeFormDocumentView } from './nodes/CollectionFreeFormDocumentView';
import { DocumentView } from './nodes/DocumentView';
import { ImageBox } from './nodes/ImageBox';
-import { OpenWhereMod } from './nodes/OpenWhere';
+import { OpenWhere, OpenWhereMod } from './nodes/OpenWhere';
import { FormattedTextBox } from './nodes/formattedText/FormattedTextBox';
interface DocumentDecorationsProps {
@@ -255,28 +255,28 @@ export class DocumentDecorations extends ObservableReactComponent<DocumentDecora
e.stopPropagation();
};
onMaximizeClick = (e: any): void => {
- const selectedDocs = DocumentView.SelectedDocs();
- if (selectedDocs.length) {
+ const selView = DocumentView.Selected()[0];
+ if (selView) {
if (e.ctrlKey) {
// open an embedding in a new tab with Ctrl Key
- CollectionDockingView.AddSplit(Doc.BestEmbedding(selectedDocs[0]), OpenWhereMod.right);
+ CollectionDockingView.AddSplit(Doc.BestEmbedding(selView.Document), OpenWhereMod.right);
} else if (e.shiftKey) {
// open centered in a new workspace with Shift Key
- const embedding = Doc.MakeEmbedding(selectedDocs[0]);
+ const embedding = Doc.MakeEmbedding(selView.Document);
embedding.embedContainer = undefined;
embedding.x = -NumCast(embedding._width) / 2;
embedding.y = -NumCast(embedding._height) / 2;
CollectionDockingView.AddSplit(Docs.Create.FreeformDocument([embedding], { title: 'Tab for ' + embedding.title }), OpenWhereMod.right);
} else if (e.altKey) {
// open same document in new tab
- CollectionDockingView.ToggleSplit(selectedDocs[0], OpenWhereMod.right);
+ CollectionDockingView.ToggleSplit(selView.Document, OpenWhereMod.right);
} else {
- let openDoc = selectedDocs[0];
+ let openDoc = selView.Document;
if (openDoc.layout_fieldKey === 'layout_icon') {
openDoc = Doc.GetEmbeddings(openDoc).find(embedding => !embedding.embedContainer) ?? Doc.MakeEmbedding(openDoc);
Doc.deiconifyView(openDoc);
}
- DocumentView.SetLightboxDoc(openDoc, undefined, selectedDocs.slice(1));
+ selView._props.addDocTab(openDoc, OpenWhere.lightboxAlways);
}
}
DocumentView.DeselectAll();