diff options
Diffstat (limited to 'js/PrefHelpers.js')
-rw-r--r-- | js/PrefHelpers.js | 44 |
1 files changed, 16 insertions, 28 deletions
diff --git a/js/PrefHelpers.js b/js/PrefHelpers.js index f7ca2525f..a3d122029 100644 --- a/js/PrefHelpers.js +++ b/js/PrefHelpers.js @@ -103,39 +103,27 @@ define(["dojo/_base/declare"], function (declare) { dialog.show(); }, customizeCSS: function() { - require(["codeflask"], function(CodeFlask) { + const query = "backend.php?op=pref-prefs&method=customizeCSS"; - const query = "backend.php?op=pref-prefs&method=customizeCSS"; + if (dijit.byId("cssEditDlg")) + dijit.byId("cssEditDlg").destroyRecursive(); - if (dijit.byId("cssEditDlg")) - dijit.byId("cssEditDlg").destroyRecursive(); - - const dialog = new dijit.Dialog({ - id: "cssEditDlg", - title: __("Customize stylesheet"), - style: "width: 600px", - execute: function () { - Notify.progress('Saving data...', true); - - const params = this.attr('value'); - params.value = this._flask.getCode(); - - xhrPost("backend.php", params, () => { - window.location.reload(); - }); - - }, - href: query - }); + const dialog = new dijit.Dialog({ + id: "cssEditDlg", + title: __("Customize stylesheet"), + style: "width: 600px", + execute: function () { + Notify.progress('Saving data...', true); - dojo.connect(dialog, "onShow", function () { - setTimeout(() => { - dialog._flask = new CodeFlask('#user-css-editor', {language: 'css'}); - }, 250); - }); + xhrPost("backend.php", this.attr('value'), () => { + window.location.reload(); + }); - dialog.show(); + }, + href: query }); + + dialog.show(); }, confirmReset: function() { if (confirm(__("Reset to defaults?"))) { |