1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 04:35:56 +00:00

shorten many invocations of Ajax.Request in inline form methods

This commit is contained in:
Andrew Dolgov
2021-02-18 12:27:26 +03:00
parent ee0b66b6bd
commit 39c0fe3697
5 changed files with 78 additions and 112 deletions

View File

@@ -69,19 +69,15 @@ class Af_Readability extends Plugin {
<?= \Controls\pluginhandler_tags($this, "save") ?>
<script type='dojo/method' event='onSubmit' args='evt'>
<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);
}
});
//this.reset();
Notify.progress('Saving data...', true);
xhrPost("backend.php", this.getValues(), (transport) => {
Notify.info(transport.responseText);
})
}
</script>
</script>
<fieldset>
<label class='checkbox'>