mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-30 20:46:47 +00:00
Add "success" functionality for form posting
This commit is contained in:
parent
981cc2e24e
commit
5230a5a41b
@ -490,11 +490,21 @@ function handleFormSuccess(response, options) {
|
|||||||
$(options.modal).modal('hide');
|
$(options.modal).modal('hide');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (response.url) {
|
if (options.onSuccess) {
|
||||||
// GOTO
|
// Callback function
|
||||||
window.location.href = response.url;
|
options.onSuccess(response, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (options.follow && response.url) {
|
||||||
|
// Follow the returned URL
|
||||||
|
window.location.href = response.url;
|
||||||
|
} else if (options.reload) {
|
||||||
|
// Reload the current page
|
||||||
|
location.reload();
|
||||||
|
} else if (options.redirect) {
|
||||||
|
// Redirect to a specified URL
|
||||||
|
window.location.href = options.redirect;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user