summaryrefslogtreecommitdiff
path: root/js/App.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-12 09:02:44 +0300
committerAndrew Dolgov <[email protected]>2021-02-12 09:02:44 +0300
commitd466284fabe945dbc3c8034ac1468bf97b38ed94 (patch)
treec500c2f43d8f6dae470072febe9177339c0c3bc3 /js/App.js
parentcb7c075cd2db606f251b852342c2ed90ac591252 (diff)
* 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
Diffstat (limited to 'js/App.js')
-rw-r--r--js/App.js33
1 files changed, 17 insertions, 16 deletions
diff --git a/js/App.js b/js/App.js
index 45de8cf0e..6d7fd1c8b 100644
--- a/js/App.js
+++ b/js/App.js
@@ -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({
- id: "helpDlg",
- title: __("Help"),
- style: "width: 600px",
- content: transport.responseText,
- });
-
- dialog.show();
- });
- },
+ xhrPost("backend.php", {op: "backend", method: "help", topic: topic}, (transport) => {
+ const dialog = new dijit.Dialog({
+ title: __("Help"),
+ content: transport.responseText,
+ });
+
+ 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
});