mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +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
@@ -1,14 +1,12 @@
|
||||
import $ from 'jquery';
|
||||
import { InfoDialog } from 'vj/components/dialog';
|
||||
import { alert } from 'vj/components/dialog';
|
||||
import { NamedPage } from 'vj/misc/Page';
|
||||
import { i18n, tpl } from 'vj/utils';
|
||||
import { i18n } from 'vj/utils';
|
||||
|
||||
export default new NamedPage(['problem_create', 'problem_edit'], () => {
|
||||
$('input[name="pid"]').on('blur', () => {
|
||||
if (/^[0-9]+$/.test($('input[name="pid"]').val())) {
|
||||
new InfoDialog({
|
||||
$body: tpl.typoMsg(i18n('Problem ID cannot be a pure number. Leave blank if you want to use numberic id.')),
|
||||
}).open();
|
||||
alert(i18n('Problem ID cannot be a pure number. Leave blank if you want to use numberic id.'));
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user