mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
1 parent
00dcf3864f
commit
ab12ca8526
10 files changed
+115
-97
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import { AutoloadPage } from 'vj/misc/Page';
|
||||
import delay from 'vj/utils/delay'
|
||||
|
||||
const formPage = new AutoloadPage('formPage', () => {
|
||||
$(document).on('vjFormDisableUpdate', 'input, select, textarea', (ev) => {
|
||||
@@ -10,6 +11,15 @@ const formPage = new AutoloadPage('formPage', () => {
|
||||
$formItem.removeClass('is--disabled');
|
||||
}
|
||||
});
|
||||
|
||||
const submitting = {};
|
||||
|
||||
$('[type="submit"]').on('click', async (ev) => {
|
||||
if (!submitting[ev.currentTarget]) $(ev.currentTarget).closest('form').submit();
|
||||
submitting[ev.currentTarget] = true;
|
||||
await delay(5000);
|
||||
submitting[ev.currentTarget] = false;
|
||||
})
|
||||
});
|
||||
|
||||
export default formPage;
|
||||
Reference in new issue
Block a user