removed lazy tinymce mount since the relation are now preloaded

This commit is contained in:
Gani Georgiev
2026-04-23 00:01:30 +03:00
parent 3566ba3729
commit 257f03e1fa
4 changed files with 16 additions and 23 deletions

View File

@@ -249,7 +249,7 @@ window.app.components.select = function(propsArg = {}) {
tabIndex: -1,
role: "button",
className: "ri-close-line link-hint btn-option-unset",
ariaLabel: app.attrs.tooltip("Unset", "left"),
ariaLabel: app.attrs.tooltip("Unset"),
onclick: () => {
toggle(opt);
return false;

View File

@@ -7,27 +7,9 @@
export function input(props) {
const uniqueId = "editor_" + app.utils.randomString();
const local = store({
lazyEditor: null,
});
return t.div(
{
className: "record-field-input field-type-editor large-modal",
onmount: () => {
requestAnimationFrame(() => {
local.lazyEditor = app.components.tinymce({
id: uniqueId,
required: () => props.field.required,
convertURLs: () => props.field.convertURLs,
name: () => props.field.name,
value: () => props.record[props.field.name] || "",
onchange: (val) => {
props.record[props.field.name] = val;
},
});
});
},
},
t.div(
{ className: "field" },
@@ -36,7 +18,18 @@ export function input(props) {
t.i({ className: app.fieldTypes.editor.icon, ariaHidden: true }),
t.span({ className: "txt" }, () => props.field.name),
),
() => local.lazyEditor,
() => {
return app.components.tinymce({
id: uniqueId,
name: () => props.field.name,
required: () => props.field.required,
convertURLs: () => props.field.convertURLs,
value: () => props.record[props.field.name] || "",
onchange: (val) => {
props.record[props.field.name] = val;
},
});
},
),
() => {
if (props.field.help) {