From 03b85248e6c7fb89f86cb98c839ab86f6162b657 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 12 Feb 2021 18:38:26 +0300 Subject: move some dialogs to xhr loading --- js/CommonDialogs.js | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'js/CommonDialogs.js') diff --git a/js/CommonDialogs.js b/js/CommonDialogs.js index fe685def3..038a2981d 100644 --- a/js/CommonDialogs.js +++ b/js/CommonDialogs.js @@ -185,8 +185,6 @@ const CommonDialogs = { }); }, showFeedsWithErrors: function() { - const query = {op: "pref-feeds", method: "feedsWithErrors"}; - const dialog = new fox.SingleUseDialog({ id: "errorFeedsDlg", title: __("Feeds with update errors"), @@ -221,12 +219,15 @@ const CommonDialogs = { alert(__("No feeds selected.")); } }, - execute: function () { - if (this.validate()) { - // - } - }, - href: "backend.php?" + dojo.objectToQuery(query) + content: __("Loading, please wait...") + }); + + const tmph = dojo.connect(dialog, 'onShow', function () { + dojo.disconnect(tmph); + + xhrPost("backend.php", {op: "pref-feeds", method: "feedsWithErrors"}, (transport) => { + dialog.attr('content', transport.responseText); + }) }); dialog.show(); @@ -313,7 +314,15 @@ const CommonDialogs = { }); } }, - href: "backend.php?" + dojo.objectToQuery(query) + content: __("Loading, please wait...") + }); + + const tmph = dojo.connect(dialog, 'onShow', function () { + dojo.disconnect(tmph); + + xhrPost("backend.php", {op: "pref-feeds", method: "editfeed", id: feed}, (transport) => { + dialog.attr('content', transport.responseText); + }) }); dialog.show(); -- cgit v1.2.3