mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: fix contest_edit
This commit is contained in:
1 parent
b406b8989d
commit
fa4b7b6f33
7 files changed
+32
-27
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { AutoloadPage } from 'vj/misc/Page';
|
||||
import delay from 'vj/utils/delay'
|
||||
import delay from 'vj/utils/delay';
|
||||
|
||||
const formPage = new AutoloadPage('formPage', () => {
|
||||
$(document).on('vjFormDisableUpdate', 'input, select, textarea', (ev) => {
|
||||
@@ -13,13 +13,14 @@ const formPage = new AutoloadPage('formPage', () => {
|
||||
});
|
||||
|
||||
const submitting = {};
|
||||
|
||||
$('[type="submit"]').on('click', async (ev) => {
|
||||
if (!submitting[ev.currentTarget]) $(ev.currentTarget).closest('form').submit();
|
||||
$(document).on('click', '[type="submit"]', (ev) => {
|
||||
const $dom = $(ev.currentTarget);
|
||||
if ($dom.attr('name') && $dom.attr('value')) return;
|
||||
ev.preventDefault();
|
||||
if (!submitting[ev.currentTarget]) $dom.closest('form').trigger('submit');
|
||||
submitting[ev.currentTarget] = true;
|
||||
await delay(5000);
|
||||
submitting[ev.currentTarget] = false;
|
||||
})
|
||||
delay(5000).then(() => { submitting[ev.currentTarget] = false; });
|
||||
});
|
||||
});
|
||||
|
||||
export default formPage;
|
||||
Reference in new issue
Block a user