From bde7bd192b1a81e3fd1c4ead13e821b95b42f3cf Mon Sep 17 00:00:00 2001 From: bobzel Date: Tue, 17 Sep 2024 21:02:35 -0400 Subject: updating packages and more cleanup of cardview merge --- src/client/views/DocumentDecorations.tsx | 3 --- src/client/views/StyleProvider.tsx | 7 +++---- src/client/views/collections/CollectionCardDeckView.tsx | 7 ++++--- src/client/views/nodes/FontIconBox/FontIconBox.tsx | 4 ++-- src/client/views/pdf/AnchorMenu.tsx | 2 +- 5 files changed, 10 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx index 37b1f04e7..5e7908725 100644 --- a/src/client/views/DocumentDecorations.tsx +++ b/src/client/views/DocumentDecorations.tsx @@ -708,7 +708,6 @@ export class DocumentDecorations extends ObservableReactComponent CollectionFreeFormDocumentView.from(v)); - - return (
Doc.toggleLockedPosition(doc), 'toggleBackground'); diff --git a/src/client/views/collections/CollectionCardDeckView.tsx b/src/client/views/collections/CollectionCardDeckView.tsx index c029d17c6..97ff852b2 100644 --- a/src/client/views/collections/CollectionCardDeckView.tsx +++ b/src/client/views/collections/CollectionCardDeckView.tsx @@ -577,7 +577,8 @@ export class CollectionCardView extends CollectionSubView() { /** * Actually renders all the cards */ - renderCards = (sortedDocs: Doc[]) => { + @computed get renderCards() { + const sortedDocs = this.sortedDocs; const anySelected = this.childDocs.some(doc => DocumentView.SelectedDocs().includes(doc)); const isEmpty = this.childDocsWithoutLinks.length === 0; const isDesc = BoolCast(this.Document.cardSort_isDesc); @@ -640,7 +641,7 @@ export class CollectionCardView extends CollectionSubView() {
); }); - }; + } render() { const isEmpty = this.childDocsWithoutLinks.length === 0; @@ -664,7 +665,7 @@ export class CollectionCardView extends CollectionSubView() { gridAutoRows: `${100 / this.numRows}%`, }} onMouseLeave={() => this.setHoveredNodeIndex(-1)}> - {this.renderCards(this.sortedDocs)} + {this.renderCards}
); diff --git a/src/client/views/nodes/FontIconBox/FontIconBox.tsx b/src/client/views/nodes/FontIconBox/FontIconBox.tsx index 7feb17df1..f53a7d163 100644 --- a/src/client/views/nodes/FontIconBox/FontIconBox.tsx +++ b/src/client/views/nodes/FontIconBox/FontIconBox.tsx @@ -157,7 +157,7 @@ export class FontIconBox extends ViewBoxBaseComponent() { let noviceList: string[] = []; let text: string | undefined; - const getStyle: (val: string) => { [key: string]: string } = () => ({}); + let getStyle: (val: string) => { [key: string]: string } = () => ({}); let icon: IconProp = 'caret-down'; const isViewDropdown = script?.script.originalScript.startsWith('{ return setView'); if (isViewDropdown) { @@ -192,7 +192,7 @@ export class FontIconBox extends ViewBoxBaseComponent() { } else { text = script?.script.run({ this: this.Document, value: '', _readOnly_: true }).result as string; // text = StrCast((RichTextMenu.Instance?.TextView?.EditorView ? RichTextMenu.Instance : Doc.UserDoc()).fontFamily); - // getStyle = (val: string) => ({ fontFamily: val }); + if (this.Document.title === 'Font') getStyle = (val: string) => ({ fontFamily: val }); // bcz: major hack to style the font dropdown items --- needs to become part of the dropdown's metadata } // Get items to place into the list diff --git a/src/client/views/pdf/AnchorMenu.tsx b/src/client/views/pdf/AnchorMenu.tsx index f5f758ad2..03585a8b7 100644 --- a/src/client/views/pdf/AnchorMenu.tsx +++ b/src/client/views/pdf/AnchorMenu.tsx @@ -133,7 +133,7 @@ export class AnchorMenu extends AntimodeMenu { _layout_autoHeight: true, }); - this.addToCollection?.(newCol); //this._props.addDocument(newCol) + this.addToCollection?.(newCol); }; pointerDown = (e: React.PointerEvent) => { -- cgit v1.2.3-70-g09d2