summaryrefslogtreecommitdiff
path: root/plugins/mail
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-11-30 15:23:48 +0300
committerAndrew Dolgov <[email protected]>2018-11-30 15:23:48 +0300
commit2f961ee830af21166d22bf3fae104291f614e7dd (patch)
tree1bc280bf9d8f480b70200fcf6dcc1d9406874bd2 /plugins/mail
parent764434a491ee0b42b70d262fa49aee2b6a9e93a8 (diff)
plugins: add some xhrPost refactoring
Diffstat (limited to 'plugins/mail')
-rw-r--r--plugins/mail/mail.js15
1 files changed, 5 insertions, 10 deletions
diff --git a/plugins/mail/mail.js b/plugins/mail/mail.js
index db0503ff9..929b35243 100644
--- a/plugins/mail/mail.js
+++ b/plugins/mail/mail.js
@@ -22,15 +22,9 @@ function emailArticle(id) {
style: "width: 600px",
execute: function() {
if (this.validate()) {
-
- new Ajax.Request("backend.php", {
- parameters: dojo.objectToQuery(this.attr('value')),
- onComplete: function(transport) {
- console.log(transport.responseText);
-
- var reply = JSON.parse(transport.responseText);
-
- var error = reply['error'];
+ xhrJson("backend.php", this.attr('value'), (reply) => {
+ if (reply) {
+ const error = reply['error'];
if (error) {
alert(__('Error sending email:') + ' ' + error);
@@ -39,7 +33,8 @@ function emailArticle(id) {
dialog.hide();
}
- } });
+ }
+ });
}
},
href: query});