CommonDialogs: refresh proper elements after feed operations in preferences

This commit is contained in:
Andrew Dolgov 2018-12-03 20:16:07 +03:00
parent 27b93988e7
commit d8d3662729
1 changed files with 33 additions and 13 deletions

View File

@ -11,11 +11,12 @@ define(["dojo/_base/declare"], function (declare) {
switch (rc) { switch (rc) {
case 0: case 0:
Notify.info("Upload complete."); Notify.info("Upload complete.");
if (App.isPrefs()) {
if (App.isPrefs())
dijit.byId("feedTree").reload();
else
Feeds.reload(); Feeds.reload();
} else {
setTimeout('Feeds.reload(false, false)', 50);
}
break; break;
case 1: case 1:
Notify.error("Upload failed: icon is too big."); Notify.error("Upload failed: icon is too big.");
@ -33,11 +34,12 @@ define(["dojo/_base/declare"], function (declare) {
xhrPost("backend.php", query, () => { xhrPost("backend.php", query, () => {
Notify.info("Feed icon removed."); Notify.info("Feed icon removed.");
if (App.isPrefs()) {
if (App.isPrefs())
dijit.byId("feedTree").reload();
else
Feeds.reload(); Feeds.reload();
} else {
setTimeout('Feeds.reload(false, false)', 50);
}
}); });
} }
@ -108,7 +110,11 @@ define(["dojo/_base/declare"], function (declare) {
dialog.hide(); dialog.hide();
Notify.info(__("Subscribed to %s").replace("%s", feed_url)); Notify.info(__("Subscribed to %s").replace("%s", feed_url));
if (App.isPrefs())
dijit.byId("feedTree").reload();
else
Feeds.reload(); Feeds.reload();
break; break;
case 2: case 2:
dialog.show_error(__("Specified URL seems to be invalid.")); dialog.show_error(__("Specified URL seems to be invalid."));
@ -190,7 +196,12 @@ define(["dojo/_base/declare"], function (declare) {
xhrPost("backend.php", query, () => { xhrPost("backend.php", query, () => {
Notify.close(); Notify.close();
dialog.hide(); dialog.hide();
if (App.isPrefs())
dijit.byId("feedTree").reload();
else
Feeds.reload(); Feeds.reload();
}); });
} }
@ -272,6 +283,10 @@ define(["dojo/_base/declare"], function (declare) {
xhrPost("backend.php", query, () => { xhrPost("backend.php", query, () => {
Notify.close(); Notify.close();
if (App.isPrefs())
dijit.byId("feedTree").reload();
else
Feeds.reload(); Feeds.reload();
}); });
@ -365,7 +380,7 @@ define(["dojo/_base/declare"], function (declare) {
if (dijit.byId("feedEditDlg")) dijit.byId("feedEditDlg").hide(); if (dijit.byId("feedEditDlg")) dijit.byId("feedEditDlg").hide();
if (App.isPrefs()) { if (App.isPrefs()) {
Feeds.reload(); dijit.byId("feedTree").reload();
} else { } else {
if (feed_id == Feeds.getActive()) if (feed_id == Feeds.getActive())
setTimeout(() => { setTimeout(() => {
@ -405,7 +420,12 @@ define(["dojo/_base/declare"], function (declare) {
xhrPost("backend.php", dialog.attr('value'), () => { xhrPost("backend.php", dialog.attr('value'), () => {
dialog.hide(); dialog.hide();
Notify.close(); Notify.close();
if (App.isPrefs())
dijit.byId("feedTree").reload();
else
Feeds.reload(); Feeds.reload();
}); });
} }
}, },