From ac95ab4a659c56afee048923883fe9ee1491c35b Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 6 Dec 2019 14:02:30 +0300 Subject: [PATCH] user css dialog: allow saving and applying CSS without closing the dialog --- classes/pref/prefs.php | 10 ++++++++-- include/functions.php | 2 +- js/PrefHelpers.js | 6 ++++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/classes/pref/prefs.php b/classes/pref/prefs.php index e66052657..b00c4c83f 100644 --- a/classes/pref/prefs.php +++ b/classes/pref/prefs.php @@ -1132,12 +1132,18 @@ class Pref_Prefs extends Handler_Protected { print_hidden("method", "setpref"); print_hidden("key", "USER_STYLESHEET"); + print ""; + print ""; print ""; diff --git a/include/functions.php b/include/functions.php index b4e91fe9c..153a96698 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1584,7 +1584,7 @@ $value = get_pref('USER_STYLESHEET'); if ($value) { - print ""; } diff --git a/js/PrefHelpers.js b/js/PrefHelpers.js index 6a62cb593..4b908204c 100644 --- a/js/PrefHelpers.js +++ b/js/PrefHelpers.js @@ -150,6 +150,12 @@ define(["dojo/_base/declare"], function (declare) { id: "cssEditDlg", title: __("Customize stylesheet"), style: "width: 600px", + apply: function() { + xhrPost("backend.php", this.attr('value'), () => { + new Effect.Appear("css_edit_apply_msg"); + $("user_css_style").innerText = this.attr('value'); + }); + }, execute: function () { Notify.progress('Saving data...', true);