From 4b4d77f99bd55e6de0593c3acd1cf5798ae038bf Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Fri, 10 May 2024 14:05:01 -0400
Subject: added an always option for OpenWhere lightbox.  cleaned up/fixed
 making collections capable of being a lightbox.

---
 src/client/views/DocumentDecorations.tsx | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

(limited to 'src/client/views/DocumentDecorations.tsx')

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();
-- 
cgit v1.2.3-70-g09d2

