From 2f4e13b1bba10e7a4f6c9b59fb1dbfd1ee72f5ed Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 20 Sep 2025 12:38:05 +0300 Subject: [PATCH] chore(react/type_widget): bring back order of editor/preview --- .../type_widgets/helpers/SplitEditor.tsx | 28 +++++++++++-------- .../abstract_split_type_widget.ts | 11 -------- 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/apps/client/src/widgets/type_widgets/helpers/SplitEditor.tsx b/apps/client/src/widgets/type_widgets/helpers/SplitEditor.tsx index 64fffd1fc..f2554d9e1 100644 --- a/apps/client/src/widgets/type_widgets/helpers/SplitEditor.tsx +++ b/apps/client/src/widgets/type_widgets/helpers/SplitEditor.tsx @@ -16,19 +16,25 @@ export default function SplitEditor({ note }: TypeWidgetProps) { const splitEditorOrientation = useSplitOrientation(); const [ readOnly ] = useNoteLabelBoolean(note, "readOnly"); + const editor = (!readOnly && +
+
Detail goes here.
+
Errors go here.
+
+ ); + + const preview = ( +
+
Preview goes here
+
Buttons go here
+
+ ); + return (
- {!readOnly && ( -
-
Detail goes here.
-
Errors go here.
-
- )} - -
-
Preview goes here
-
Buttons go here
-
+ {splitEditorOrientation === "horizontal" + ? <>{editor}{preview} + : <>{preview}{editor}}
) } diff --git a/apps/client/src/widgets/type_widgets_old/abstract_split_type_widget.ts b/apps/client/src/widgets/type_widgets_old/abstract_split_type_widget.ts index 3850bd083..5234f0037 100644 --- a/apps/client/src/widgets/type_widgets_old/abstract_split_type_widget.ts +++ b/apps/client/src/widgets/type_widgets_old/abstract_split_type_widget.ts @@ -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(); - } - } - }