mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
ui: add alert/prompt/confirm helper function (#1018)
This commit is contained in:
1 parent
2d7979105e
commit
d4271b3fbd
12 files changed
+176
-196
No files matched your search
@@ -2,7 +2,7 @@ import $ from 'jquery';
|
||||
import yaml from 'js-yaml';
|
||||
import React from 'react';
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import { ConfirmDialog } from 'vj/components/dialog';
|
||||
import { confirm } from 'vj/components/dialog';
|
||||
import Notification from 'vj/components/notification';
|
||||
import { downloadProblemSet } from 'vj/components/zipDownloader';
|
||||
import { NamedPage } from 'vj/misc/Page';
|
||||
@@ -316,10 +316,7 @@ const page = new NamedPage(['problem_detail', 'contest_detail_problem', 'homewor
|
||||
</a>
|
||||
</li>));
|
||||
$(document).on('click', '#clearAnswers', async () => {
|
||||
const result = await new ConfirmDialog({
|
||||
$body: tpl.typoMsg(i18n('All changes will be lost. Are you sure to clear all answers?')),
|
||||
}).open();
|
||||
if (result === 'yes') await clearAns();
|
||||
if (await confirm(i18n('All changes will be lost. Are you sure to clear all answers?'))) await clearAns();
|
||||
});
|
||||
}
|
||||
const ele = document.createElement('div');
|
||||
|
||||
Reference in new issue
Block a user