1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 10:45:56 +00:00

* OPML import: don't reload everything, just feed tree

* dialogs: use auto-destroying dialog for almost all dialogs instead of destroying them manually
* some general dialog-related cleanup
This commit is contained in:
Andrew Dolgov
2021-02-12 15:22:10 +03:00
parent 219cc9a0ab
commit 3d11c61f32
18 changed files with 275 additions and 351 deletions

View File

@@ -1,7 +1,7 @@
'use strict'
/* global __ */
/* global xhrPost, dojo, dijit, Notify, Tables */
/* global xhrPost, dojo, dijit, Notify, Tables, fox */
const Users = {
reload: function(sort) {
@@ -27,29 +27,25 @@ const Users = {
}
},
edit: function(id) {
const query = "backend.php?op=pref-users&method=edit&id=" +
encodeURIComponent(id);
xhrPost('backend.php', {op: 'pref-users', method: 'edit', id: id}, (transport) => {
const dialog = new fox.SingleUseDialog({
id: "userEditDlg",
title: __("User Editor"),
execute: function () {
if (this.validate()) {
Notify.progress("Saving data...", true);
if (dijit.byId("userEditDlg"))
dijit.byId("userEditDlg").destroyRecursive();
xhrPost("backend.php", dojo.formToObject("user_edit_form"), (/* transport */) => {
dialog.hide();
Users.reload();
});
}
},
content: transport.responseText
});
const dialog = new dijit.Dialog({
id: "userEditDlg",
title: __("User Editor"),
execute: function () {
if (this.validate()) {
Notify.progress("Saving data...", true);
xhrPost("backend.php", dojo.formToObject("user_edit_form"), (/* transport */) => {
dialog.hide();
Users.reload();
});
}
},
href: query
dialog.show();
});
dialog.show();
},
resetSelected: function() {
const rows = this.getSelection();