From 934c232fabb2f7a16d3efe1f048649b63b327d2c Mon Sep 17 00:00:00 2001 From: eperelm2 Date: Wed, 5 Jul 2023 15:47:18 -0400 Subject: trying to add importBox --- .../views/nodes/importBox/ImportElementBox.tsx | 70 ++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 src/client/views/nodes/importBox/ImportElementBox.tsx (limited to 'src/client/views/nodes') diff --git a/src/client/views/nodes/importBox/ImportElementBox.tsx b/src/client/views/nodes/importBox/ImportElementBox.tsx new file mode 100644 index 000000000..a5d21cc8e --- /dev/null +++ b/src/client/views/nodes/importBox/ImportElementBox.tsx @@ -0,0 +1,70 @@ +import { observer } from "mobx-react"; +import { ViewBoxBaseComponent } from "../../DocComponent"; +import { FieldView, FieldViewProps } from "../FieldView"; +import { computed } from "mobx"; +import { Id } from "../../../../fields/FieldSymbols"; +import React from "react"; +import { EditableView } from "../../EditableView"; +import { DocListCast } from "../../../../fields/Doc"; +import { StrCast } from "../../../../fields/Types"; + + +@observer +export class ImportElementBox extends ViewBoxBaseComponent() { + public static LayoutString(fieldKey: string) { + return FieldView.LayoutString(ImportElementBox, fieldKey); + } + + private _itemRef: React.RefObject = React.createRef(); + private _dragRef: React.RefObject = React.createRef(); + private _titleRef: React.RefObject = React.createRef(); + + @computed importBoxVoew() { + return this.props.DocumentView?.()?.props.docViewPath().lastElement()?.ComponentView as PresBox; + } + + @computed get indexInPres() { + return DocListCast(this.presBox?.[StrCast(this.presBox.presFieldKey, 'data')]).indexOf(this.rootDoc); + } + + @computed get presBox() { + return this.props.DocumentView?.().props.docViewPath().lastElement()?.rootDoc; + } + + // @computed get selectedArray() { + // return this.presBoxView?.selectedArray; + // } + +@computed get mainItem() { + const isCurrent: boolean = this.presBox?._itemIndex === this.indexInPres; + //const isSelected: boolean = this.selectedArray?.has(this.rootDoc) ? true : false; + // const activeItem: Doc = this.rootDoc; + + return( +
+
+
+ {/* StrCast(activeItem.title)} SetValue={this.onSetValue} /> */} + +
+
+ +
+ ) +} + +} \ No newline at end of file -- cgit v1.2.3-70-g09d2 From b62a751b6a16acd28b4f9a9794ded6ea14fa0de8 Mon Sep 17 00:00:00 2001 From: Geireann Lindfield Roberts <60007097+geireann@users.noreply.github.com> Date: Tue, 18 Jul 2023 12:55:43 -0400 Subject: fixed ClickButton --- src/client/util/CurrentUserUtils.ts | 2 +- src/client/views/nodes/FontIconBox/FontIconBox.tsx | 15 ++++++++------- .../buxton/narratives/.Theme - Chord Kbds.docx.icloud | Bin 175 -> 0 bytes 3 files changed, 9 insertions(+), 8 deletions(-) delete mode 100644 src/scraping/buxton/narratives/.Theme - Chord Kbds.docx.icloud (limited to 'src/client/views/nodes') diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts index d93ee9a2e..a7775715c 100644 --- a/src/client/util/CurrentUserUtils.ts +++ b/src/client/util/CurrentUserUtils.ts @@ -822,7 +822,7 @@ export class CurrentUserUtils { const reqdBtnOpts:DocumentOptions = { _forceActive: true, toolTip: "Import from computer", _width: 30, _height: 30, color: Colors.BLACK, _dragOnlyWithinContainer: true, _layout_hideContextMenu: true, title: "Import", btnType: ButtonType.ClickButton, - buttonText: "Import", icon: "upload", isSystem: true }; + buttonText: "Import", icon: "upload", isSystem: true, ignoreClick: true }; DocUtils.AssignDocField(myImports, "layout_headerButton", (opts) => Docs.Create.FontIconDocument(opts), reqdBtnOpts, undefined, { onClick: "importDocument()" }); return myImports; } diff --git a/src/client/views/nodes/FontIconBox/FontIconBox.tsx b/src/client/views/nodes/FontIconBox/FontIconBox.tsx index 39be4022e..f676641ac 100644 --- a/src/client/views/nodes/FontIconBox/FontIconBox.tsx +++ b/src/client/views/nodes/FontIconBox/FontIconBox.tsx @@ -398,18 +398,19 @@ export class FontIconBox extends DocComponent() { button = this.dropdownButton; break; case ButtonType.ToggleButton: button = this.toggleButton; break; - case ButtonType.TextButton: - const script = ScriptCast(this.rootDoc.script); + case ButtonType.ClickButton: + case ButtonType.ToolButton: + const script = ScriptCast(this.rootDoc.onClick); const checkResult = script?.script.run({ _readOnly_: true }).result; - // Script for checking the outcome of the toggle button = ( -