1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-15 17:25:57 +00:00

plugins: load dialogs via xhr instead of http

This commit is contained in:
Andrew Dolgov
2021-02-17 14:56:36 +03:00
parent 4632d6cf55
commit 2b2833bb4f
7 changed files with 49 additions and 55 deletions

View File

@@ -1,11 +1,8 @@
/* global Plugins, xhrJson, Notify, fox, __ */
/* global dojo, xhrPost, Plugins, xhrJson, Notify, fox, __ */
Plugins.Note = {
edit: function(id) {
const query = "backend.php?op=pluginhandler&plugin=note&method=edit&param=" + encodeURIComponent(id);
const dialog = new fox.SingleUseDialog({
id: "editNoteDlg",
title: __("Edit article note"),
execute: function () {
if (this.validate()) {
@@ -30,7 +27,15 @@ Plugins.Note = {
});
}
},
href: query,
content: __("Loading, please wait...")
});
const tmph = dojo.connect(dialog, 'onShow', function () {
dojo.disconnect(tmph);
xhrPost("backend.php", {op: "pluginhandler", plugin: "note", method: "edit", id: id}, (transport) => {
dialog.attr('content', transport.responseText);
});
});
dialog.show();