1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 20:05:55 +00:00

* customizeCSS: client dialog

* remove hardcoded width from most dialogs (move to css)
* add helper to easily get dialog from its widget
* rework some dialog buttons to use current object instead of calling dialog by name
This commit is contained in:
Andrew Dolgov
2021-02-12 09:02:44 +03:00
parent cb7c075cd2
commit d466284fab
23 changed files with 97 additions and 78 deletions

View File

@@ -16,6 +16,11 @@ const App = {
hotkey_actions: {},
is_prefs: false,
LABEL_BASE_INDEX: -1024,
FormFields: {
hidden: function(name, value) {
return `<input dojoType="dijit.form.TextBox" style="display : none" name="${name}" value="${value}"></input>`
}
},
Scrollable: {
scrollByPages: function (elem, page_offset) {
if (!elem) return;
@@ -49,6 +54,9 @@ const App = {
elem.offsetTop >= ctr.scrollTop;
}
},
dialogOf: function (widget) {
return dijit.getEnclosingWidget(widget.domNode.closest('.dijitDialog'));
},
label_to_feed_id: function(label) {
return this.LABEL_BASE_INDEX - 1 - Math.abs(label);
},
@@ -300,20 +308,15 @@ const App = {
}
},
helpDialog: function(topic) {
if (dijit.byId("helpDlg"))
dijit.byId("helpDlg").destroyRecursive();
xhrPost("backend.php", {op: "backend", method: "help", topic: topic}, (transport) => {
const dialog = new dijit.Dialog({
title: __("Help"),
content: transport.responseText,
});
xhrPost("backend.php", {op: "backend", method: "help", topic: topic}, (transport) => {
const dialog = new dijit.Dialog({
id: "helpDlg",
title: __("Help"),
style: "width: 600px",
content: transport.responseText,
});
dialog.show();
});
},
dialog.show();
});
},
displayDlg: function(title, id, param, callback) {
Notify.progress("Loading, please wait...", true);
@@ -329,7 +332,6 @@ const App = {
dialog = new dijit.Dialog({
title: title,
id: 'infoBox',
style: "width: 600px",
onCancel: function () {
return true;
},
@@ -596,7 +598,6 @@ const App = {
const dialog = new dijit.Dialog({
id: "exceptionDlg",
title: params.title || __("Unhandled exception"),
style: "width: 600px",
content: content
});