mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-03 17:30:11 +00:00
parent
010ea26c85
commit
584f015328
2 changed files with 5 additions and 10 deletions
|
|
@ -26,10 +26,6 @@
|
|||
this.options.onModalInit(this.fillFormModal());
|
||||
}
|
||||
|
||||
updateCsrf(newCsrf) {
|
||||
this.csrf = newCsrf;
|
||||
}
|
||||
|
||||
delegateSubmit() {
|
||||
|
||||
this.bindFormValidation();
|
||||
|
|
@ -89,7 +85,7 @@
|
|||
const submitButton = $(this.element).find(`[type='submit']`);
|
||||
let dataToSend = this.options.beforeSumbit();
|
||||
|
||||
if (this.options.method == 'post') dataToSend.csrf = this.csrf;
|
||||
dataToSend.csrf = this.csrf;
|
||||
dataToSend = $.extend(dataToSend, this.options.submitOptions);
|
||||
|
||||
/* clean previous state and disable button */
|
||||
|
|
@ -100,8 +96,7 @@
|
|||
|
||||
method(this.options.endpoint, dataToSend)
|
||||
.done(function (response, textStatus) {
|
||||
if (response.csrf) self.updateCsrf(response.csrf);
|
||||
if (self.resetAfterSubmit) self.cleanForm();
|
||||
if (self.options.resetAfterSubmit) self.cleanForm();
|
||||
self.options.onSubmitSuccess(response, dataToSend);
|
||||
/* unbind the old closure on submit event and bind a new one */
|
||||
$(self.element).off('submit', self.submitHandler);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue