mirror of
https://github.com/zadam/trilium.git
synced 2025-11-11 17:08:58 +01: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 [ 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 (
|
||||
<div className={`note-detail-split note-detail-printable ${"split-" + splitEditorOrientation} ${readOnly ? "split-read-only" : ""}`}>
|
||||
{!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>
|
||||
)}
|
||||
|
||||
<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>
|
||||
{splitEditorOrientation === "horizontal"
|
||||
? <>{editor}{preview}</>
|
||||
: <>{preview}{editor}</>}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@ -104,11 +104,6 @@ export default abstract class AbstractSplitTypeWidget extends TypeWidget {
|
||||
return;
|
||||
}
|
||||
|
||||
let elements = [ this.$editorCol[0], this.$previewCol[0] ];
|
||||
if (this.layoutOrientation === "vertical") {
|
||||
elements.reverse();
|
||||
}
|
||||
|
||||
this.splitInstance?.destroy();
|
||||
|
||||
if (!this.isReadOnly) {
|
||||
@ -158,10 +153,4 @@ export default abstract class AbstractSplitTypeWidget extends TypeWidget {
|
||||
return this.editorTypeWidget.getData();
|
||||
}
|
||||
|
||||
entitiesReloadedEvent({ loadResults }: EventData<"entitiesReloaded">) {
|
||||
if (loadResults.isOptionReloaded("splitEditorOrientation")) {
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user