show user css editor before xhr is completed
This commit is contained in:
parent
bfeaf4d6a4
commit
28dd255c30
|
@ -322,7 +322,7 @@ const Article = {
|
||||||
},
|
},
|
||||||
editTags: function (id) {
|
editTags: function (id) {
|
||||||
const dialog = new fox.SingleUseDialog({
|
const dialog = new fox.SingleUseDialog({
|
||||||
title: __("Edit article Tags"),
|
title: __("Article tags"),
|
||||||
content: `
|
content: `
|
||||||
${App.FormFields.hidden_tag("id", id.toString())}
|
${App.FormFields.hidden_tag("id", id.toString())}
|
||||||
${App.FormFields.hidden_tag("op", "article")}
|
${App.FormFields.hidden_tag("op", "article")}
|
||||||
|
@ -334,7 +334,7 @@ const Article = {
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
<textarea dojoType='dijit.form.SimpleTextarea' rows='4' disabled='true'
|
<textarea dojoType='dijit.form.SimpleTextarea' rows='4' disabled='true'
|
||||||
id='tags_str' name='tags_str'></textarea>
|
id='tags_str' name='tags_str'>${__("Loading, please wait...")}</textarea>
|
||||||
<div class='autocomplete' id='tags_choices' style='display:none'></div>
|
<div class='autocomplete' id='tags_choices' style='display:none'></div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
|
@ -239,8 +239,6 @@ const Helpers = {
|
||||||
},
|
},
|
||||||
Prefs: {
|
Prefs: {
|
||||||
customizeCSS: function() {
|
customizeCSS: function() {
|
||||||
xhr.json("backend.php", {op: "pref-prefs", method: "customizeCSS"}, (reply) => {
|
|
||||||
|
|
||||||
const dialog = new fox.SingleUseDialog({
|
const dialog = new fox.SingleUseDialog({
|
||||||
title: __("Customize stylesheet"),
|
title: __("Customize stylesheet"),
|
||||||
apply: function() {
|
apply: function() {
|
||||||
|
@ -271,8 +269,8 @@ const Helpers = {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<textarea class='panel user-css-editor' dojoType='dijit.form.SimpleTextarea'
|
<textarea class='panel user-css-editor' disabled='true' dojoType='dijit.form.SimpleTextarea'
|
||||||
style='font-size : 12px;' name='value'>${reply.value}</textarea>
|
style='font-size : 12px;' name='value'>${__("Loading, please wait...")}</textarea>
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
<button dojoType='dijit.form.Button' class='alt-success' onclick="App.dialogOf(this).apply()">
|
<button dojoType='dijit.form.Button' class='alt-success' onclick="App.dialogOf(this).apply()">
|
||||||
|
@ -290,9 +288,21 @@ const Helpers = {
|
||||||
`
|
`
|
||||||
});
|
});
|
||||||
|
|
||||||
dialog.show();
|
const tmph = dojo.connect(dialog, 'onShow', function () {
|
||||||
|
dojo.disconnect(tmph);
|
||||||
|
|
||||||
|
xhr.json("backend.php", {op: "pref-prefs", method: "customizeCSS"}, (reply) => {
|
||||||
|
|
||||||
|
const editor = dijit.getEnclosingWidget(dialog.domNode.querySelector(".user-css-editor"));
|
||||||
|
|
||||||
|
editor.attr('value', reply.value);
|
||||||
|
editor.attr('disabled', false);
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
dialog.show();
|
||||||
|
|
||||||
},
|
},
|
||||||
confirmReset: function() {
|
confirmReset: function() {
|
||||||
if (confirm(__("Reset to defaults?"))) {
|
if (confirm(__("Reset to defaults?"))) {
|
||||||
|
|
Loading…
Reference in New Issue