diff --git a/Resources/Plugins/edit-design/browser.js b/Resources/Plugins/edit-design/browser.js index 522f794b..f51ec9c5 100644 --- a/Resources/Plugins/edit-design/browser.js +++ b/Resources/Plugins/edit-design/browser.js @@ -111,15 +111,30 @@ enabled(){ modal.find("[data-td-key]").each(function(){ let item = $(this); + let tag = item.prop("tagName"); let key = item.attr("data-td-key"); - if (item.prop("tagName") === "SELECT"){ + // INPUTS + if (tag === "INPUT"){ + let type = item.attr("type"); + + if (type === "checkbox"){ + item.prop("checked", me.config[key]); + + item.change(function(){ + updateKey(key, item.prop("checked")); + }); + } + } + // SELECTS + else if (tag === "SELECT"){ item.val(me.config[key]); item.change(function(){ updateKey(key, item.val()); }); } + // CUSTOM ELEMENTS else{ let value = item.attr("data-td-value"); @@ -138,8 +153,10 @@ enabled(){ modal.find("[data-td-theme='"+TD.settings.getTheme()+"']").prop("checked", true); modal.find("[data-td-theme]").change(function(){ - TD.settings.setTheme($(this).attr("data-td-theme")); - $(document).trigger("uiToggleTheme"); + setTimeout(function(){ + TD.settings.setTheme($(this).attr("data-td-theme")); + $(document).trigger("uiToggleTheme"); + }, 1); }); }).methods({ _render: () => $(this.htmlModal), diff --git a/Resources/Plugins/edit-design/modal.html b/Resources/Plugins/edit-design/modal.html index 238edb0f..79316032 100644 --- a/Resources/Plugins/edit-design/modal.html +++ b/Resources/Plugins/edit-design/modal.html @@ -142,6 +142,11 @@ cursor: pointer; } + .td-modal-content label.checkbox { + margin: 6px 16px 5px 4px; + cursor: pointer; + } + /* Avatar shape */ .td-avatar-shape-container {