|
|
|
|
@ -3,7 +3,7 @@ import utils from "../../../../services/utils.js";
|
|
|
|
|
import OptionsWidget from "../options_widget.js";
|
|
|
|
|
|
|
|
|
|
const TPL = `
|
|
|
|
|
<div class="options-section">
|
|
|
|
|
<div class="options-section formatting-toolbar">
|
|
|
|
|
<h4>${t("editing.editor_type.label")}</h4>
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
@ -20,9 +20,23 @@ const TPL = `
|
|
|
|
|
<strong>${t("editing.editor_type.fixed.title")}</strong>
|
|
|
|
|
- ${t("editing.editor_type.fixed.description")}
|
|
|
|
|
</label>
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
<label>
|
|
|
|
|
<input type="checkbox" name="multiline-toolbar" />
|
|
|
|
|
Display the toolbar on multiple lines if it doesn't fit.
|
|
|
|
|
</label>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>`;
|
|
|
|
|
<style>
|
|
|
|
|
.formatting-toolbar div > div {
|
|
|
|
|
margin-left: 1em;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
export default class EditorOptions extends OptionsWidget {
|
|
|
|
|
doRender() {
|
|
|
|
|
@ -33,10 +47,14 @@ export default class EditorOptions extends OptionsWidget {
|
|
|
|
|
await this.updateOption('textNoteEditorType', newEditorType);
|
|
|
|
|
utils.reloadFrontendApp("editor type change");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
this.$multilineToolbarCheckbox = this.$widget.find('input[name="multiline-toolbar"]');
|
|
|
|
|
this.$multilineToolbarCheckbox.on("change", () => this.updateCheckboxOption("textNoteEditorMultilineToolbar", this.$multilineToolbarCheckbox));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async optionsLoaded(options) {
|
|
|
|
|
this.$widget.find(`input[name="editor-type"][value="${options.textNoteEditorType}"]`)
|
|
|
|
|
.prop("checked", "true");
|
|
|
|
|
this.setCheckboxState(this.$multilineToolbarCheckbox, options.textNoteEditorMultilineToolbar);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|