mirror of
https://github.com/TriliumNext/Trilium.git
synced 2025-12-10 03:53:37 -06:00
chore(react/type_widget): bring back order of editor/preview
This commit is contained in:
parent
c8a9b994d6
commit
2f4e13b1bb
@ -16,19 +16,25 @@ export default function SplitEditor({ note }: TypeWidgetProps) {
|
|||||||
const splitEditorOrientation = useSplitOrientation();
|
const splitEditorOrientation = useSplitOrientation();
|
||||||
const [ readOnly ] = useNoteLabelBoolean(note, "readOnly");
|
const [ readOnly ] = useNoteLabelBoolean(note, "readOnly");
|
||||||
|
|
||||||
|
const editor = (!readOnly &&
|
||||||
|
<div className="note-detail-split-editor-col">
|
||||||
|
<div className="note-detail-split-editor">Detail goes here.</div>
|
||||||
|
<div className="admonition caution note-detail-error-container hidden-ext">Errors go here.</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
|
const preview = (
|
||||||
|
<div className="note-detail-split-preview-col">
|
||||||
|
<div className="note-detail-split-preview">Preview goes here</div>
|
||||||
|
<div className="btn-group btn-group-sm map-type-switcher content-floating-buttons preview-buttons bottom-right" role="group">Buttons go here</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`note-detail-split note-detail-printable ${"split-" + splitEditorOrientation} ${readOnly ? "split-read-only" : ""}`}>
|
<div className={`note-detail-split note-detail-printable ${"split-" + splitEditorOrientation} ${readOnly ? "split-read-only" : ""}`}>
|
||||||
{!readOnly && (
|
{splitEditorOrientation === "horizontal"
|
||||||
<div className="note-detail-split-editor-col">
|
? <>{editor}{preview}</>
|
||||||
<div className="note-detail-split-editor">Detail goes here.</div>
|
: <>{preview}{editor}</>}
|
||||||
<div className="admonition caution note-detail-error-container hidden-ext">Errors go here.</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<div className="note-detail-split-preview-col">
|
|
||||||
<div className="note-detail-split-preview">Preview goes here</div>
|
|
||||||
<div className="btn-group btn-group-sm map-type-switcher content-floating-buttons preview-buttons bottom-right" role="group">Buttons go here</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -104,11 +104,6 @@ export default abstract class AbstractSplitTypeWidget extends TypeWidget {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let elements = [ this.$editorCol[0], this.$previewCol[0] ];
|
|
||||||
if (this.layoutOrientation === "vertical") {
|
|
||||||
elements.reverse();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.splitInstance?.destroy();
|
this.splitInstance?.destroy();
|
||||||
|
|
||||||
if (!this.isReadOnly) {
|
if (!this.isReadOnly) {
|
||||||
@ -158,10 +153,4 @@ export default abstract class AbstractSplitTypeWidget extends TypeWidget {
|
|||||||
return this.editorTypeWidget.getData();
|
return this.editorTypeWidget.getData();
|
||||||
}
|
}
|
||||||
|
|
||||||
entitiesReloadedEvent({ loadResults }: EventData<"entitiesReloaded">) {
|
|
||||||
if (loadResults.isOptionReloaded("splitEditorOrientation")) {
|
|
||||||
this.refresh();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user