diff options
author | bobzel <zzzman@gmail.com> | 2024-10-02 12:53:07 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2024-10-02 12:53:07 -0400 |
commit | 32efd65cbcd824bb39d5e36a90711305b14710f7 (patch) | |
tree | 6195bdb957e1d235e9b3db484872f2a85ae685cb /src/client/views/global/globalScripts.ts | |
parent | e29b76c89532aefaa27c9950981f6405ac3899d9 (diff) | |
parent | 49b49ac6a273264b02c8bde620517c8af3971b09 (diff) |
merged with master
Diffstat (limited to 'src/client/views/global/globalScripts.ts')
-rw-r--r-- | src/client/views/global/globalScripts.ts | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/client/views/global/globalScripts.ts b/src/client/views/global/globalScripts.ts index a093d7093..423a2d6ef 100644 --- a/src/client/views/global/globalScripts.ts +++ b/src/client/views/global/globalScripts.ts @@ -18,7 +18,7 @@ import { InkTranscription } from '../InkTranscription'; import { InkingStroke } from '../InkingStroke'; import { MainView } from '../MainView'; import { PropertiesView } from '../PropertiesView'; -import { CollectionFreeFormView, MarqueeView } from '../collections/collectionFreeForm'; +import { CollectionFreeFormView } from '../collections/collectionFreeForm'; import { CollectionFreeFormDocumentView } from '../nodes/CollectionFreeFormDocumentView'; import { ActiveEraserWidth, @@ -135,7 +135,11 @@ ScriptingGlobals.add(function toggleOverlay(checkResult?: boolean) { }); // eslint-disable-next-line prefer-arrow-callback -ScriptingGlobals.add(function showFreeform(attr: 'hcenter' | 'vcenter' | 'grid' | 'snaplines' | 'clusters' | 'viewAll' | 'fitOnce', checkResult?: boolean, persist?: boolean) { +ScriptingGlobals.add(function showFreeform( + attr: 'flashcards' | 'hcenter' | 'vcenter' | 'grid' | 'snaplines' | 'clusters' | 'viewAll' | 'fitOnce' | 'time' | 'docType' | 'color' | 'chat' | 'up' | 'down' | 'pile' | 'toggle-chat' | 'toggle-tags' | 'tag', + checkResult?: boolean, + persist?: boolean +) { const selected = DocumentView.SelectedDocs().lastElement(); function isAttrFiltered(attribute: string) { @@ -143,7 +147,7 @@ ScriptingGlobals.add(function showFreeform(attr: 'hcenter' | 'vcenter' | 'grid' } // prettier-ignore - const map: Map<'flashcards' | 'hcenter' | 'vcenter' | 'grid' | 'snaplines' | 'clusters' | 'viewAll' | 'fitOnce' | 'time' | 'docType' | 'color' | 'chat' | 'up' | 'down' | 'pile' | 'toggle-chat' | 'tag', + const map: Map<'flashcards' | 'hcenter' | 'vcenter' | 'grid' | 'snaplines' | 'clusters' | 'viewAll' | 'fitOnce' | 'time' | 'docType' | 'color' | 'chat' | 'up' | 'down' | 'pile' | 'toggle-chat' | 'toggle-tags' | 'tag', { waitForRender?: boolean; checkResult: (doc: Doc) => boolean; @@ -227,6 +231,12 @@ ScriptingGlobals.add(function showFreeform(attr: 'hcenter' | 'vcenter' | 'grid' }, }], + ['toggle-tags', { + checkResult: (doc: Doc) => BoolCast(doc?.showChildTags), + setDoc: (doc: Doc, dv: DocumentView) => { + doc.showChildTags = !doc.showChildTags; + }, + }], ['pile', { checkResult: (doc: Doc) => doc._type_collection == CollectionViewType.Freeform, setDoc: (doc: Doc, dv: DocumentView) => { |