summaryrefslogtreecommitdiff
path: root/plugins/mail/init.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-18 12:27:26 +0300
committerAndrew Dolgov <[email protected]>2021-02-18 12:27:26 +0300
commit39c0fe3697c71e9cfeec74c020b0c31fca376dc0 (patch)
treeb67a018eb001e5c819f3366bc62f2e69b3ff0cd0 /plugins/mail/init.php
parentee0b66b6bd14d116b878a57f1d35b466d9994138 (diff)
shorten many invocations of Ajax.Request in inline form methods
Diffstat (limited to 'plugins/mail/init.php')
-rw-r--r--plugins/mail/init.php14
1 files changed, 5 insertions, 9 deletions
diff --git a/plugins/mail/init.php b/plugins/mail/init.php
index 4b62d1e64..d96006b21 100644
--- a/plugins/mail/init.php
+++ b/plugins/mail/init.php
@@ -50,15 +50,12 @@ class Mail extends Plugin {
<script type="dojo/method" event="onSubmit" args="evt">
evt.preventDefault();
if (this.validate()) {
- console.log(dojo.objectToQuery(this.getValues()));
- new Ajax.Request('backend.php', {
- parameters: dojo.objectToQuery(this.getValues()),
- onComplete: function(transport) {
- Notify.info(transport.responseText);
- }
- });
+ Notify.progress('Saving data...', true);
+ xhrPost("backend.php", this.getValues(), (transport) => {
+ Notify.info(transport.responseText);
+ })
}
- </script>
+ </script>
<header><?= __("You can set predefined email addressed here (comma-separated list):") ?></header>
@@ -70,7 +67,6 @@ class Mail extends Plugin {
<?= \Controls\submit_tag(__("Save")) ?>
</form>
-
</div>
<?php
}