summaryrefslogtreecommitdiff
path: root/plugins/mail/mail.js
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/mail/mail.js')
-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});