diff options
author | Andrew Dolgov <[email protected]> | 2021-02-17 14:56:36 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-02-17 14:56:36 +0300 |
commit | 2b2833bb4fa6f958b89a83adea89d9e7c73daee7 (patch) | |
tree | 8e57050458d81dfe6841150c82b8013af5d14eb2 /plugins/mail/mail.js | |
parent | 4632d6cf558774cfcb17b3b4cf10399c3626096b (diff) |
plugins: load dialogs via xhr instead of http
Diffstat (limited to 'plugins/mail/mail.js')
-rw-r--r-- | plugins/mail/mail.js | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/plugins/mail/mail.js b/plugins/mail/mail.js index 5ddc0dc41..4cdf6999d 100644 --- a/plugins/mail/mail.js +++ b/plugins/mail/mail.js @@ -1,4 +1,4 @@ -/* global Plugins, Headlines, xhrJson, Notify, fox, __ */ +/* global Plugins, Headlines, dojo, xhrPost, xhrJson, Notify, fox, __ */ Plugins.Mail = { send: function(id) { @@ -13,10 +13,7 @@ Plugins.Mail = { id = ids.toString(); } - const query = "backend.php?op=pluginhandler&plugin=mail&method=emailArticle¶m=" + encodeURIComponent(id); - const dialog = new fox.SingleUseDialog({ - id: "emailArticleDlg", title: __("Forward article by email"), execute: function () { if (this.validate()) { @@ -35,16 +32,16 @@ Plugins.Mail = { }); } }, - href: query + content: __("Loading, please wait...") }); - /* var tmph = dojo.connect(dialog, 'onLoad', function() { - dojo.disconnect(tmph); + const tmph = dojo.connect(dialog, 'onShow', function () { + dojo.disconnect(tmph); - new Ajax.Autocompleter('emailArticleDlg_destination', 'emailArticleDlg_dst_choices', - "backend.php?op=pluginhandler&plugin=mail&method=completeEmails", - { tokens: '', paramName: "search" }); - }); */ + xhrPost("backend.php", {op: "pluginhandler", plugin: "mail", method: "emailArticle", ids: id}, (transport) => { + dialog.attr('content', transport.responseText); + }); + }); dialog.show(); }, |