diff --git a/apps/client/src/widgets/type_widgets/helpers/SplitEditor.tsx b/apps/client/src/widgets/type_widgets/helpers/SplitEditor.tsx
index 62c1b8161..64fffd1fc 100644
--- a/apps/client/src/widgets/type_widgets/helpers/SplitEditor.tsx
+++ b/apps/client/src/widgets/type_widgets/helpers/SplitEditor.tsx
@@ -1,5 +1,5 @@
import { isMobile } from "../../../services/utils";
-import { useTriliumOption } from "../../react/hooks";
+import { useNoteLabel, useNoteLabelBoolean, useTriliumOption } from "../../react/hooks";
import { TypeWidgetProps } from "../type_widget";
import "./SplitEditor.css";
@@ -12,14 +12,19 @@ import "./SplitEditor.css";
* - Can display errors to the user via {@link setError}.
* - Horizontal or vertical orientation for the editor/preview split, adjustable via the switch split orientation button floating button.
*/
-export default function SplitEditor({ }: TypeWidgetProps) {
+export default function SplitEditor({ note }: TypeWidgetProps) {
const splitEditorOrientation = useSplitOrientation();
+ const [ readOnly ] = useNoteLabelBoolean(note, "readOnly");
+
return (
-
-
-
Detail goes here.
-
Errors go here.
-
+
+ {!readOnly && (
+
+
Detail goes here.
+
Errors go here.
+
+ )}
+
Preview goes here
Buttons go here
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 bd2b3b567..3850bd083 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
@@ -85,12 +85,6 @@ export default abstract class AbstractSplitTypeWidget extends TypeWidget {
}
#adjustLayoutOrientation() {
- // Read-only
- const isReadOnly = this.note?.hasLabel("readOnly");
- if (this.isReadOnly !== isReadOnly) {
- this.$editorCol.toggle(!isReadOnly);
- }
-
// Vertical vs horizontal layout
if (this.layoutOrientation !== layoutOrientation || this.isReadOnly !== isReadOnly) {
this.$widget
diff --git a/packages/commons/src/lib/attribute_names.ts b/packages/commons/src/lib/attribute_names.ts
index ed527308a..68fa1af3c 100644
--- a/packages/commons/src/lib/attribute_names.ts
+++ b/packages/commons/src/lib/attribute_names.ts
@@ -29,7 +29,6 @@ type Labels = {
status: string;
pageSize: number;
geolocation: string;
- readOnly: boolean;
expanded: boolean;
"calendar:hideWeekends": boolean;
"calendar:weekNumbers": boolean;
@@ -42,6 +41,7 @@ type Labels = {
// Note-type specific
webViewSrc: string;
+ readOnly: boolean;
}
/**