mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
表单增加 data-confirm 配置
This commit is contained in:
parent
661ea46e08
commit
1f7f94431c
@ -492,10 +492,14 @@ $(function () {
|
|||||||
$('form[data-auto]').map(function (index, form) {
|
$('form[data-auto]').map(function (index, form) {
|
||||||
if (this.dataset.listen === 'true') return true;
|
if (this.dataset.listen === 'true') return true;
|
||||||
$(this).attr('data-listen', 'true').vali(function (data) {
|
$(this).attr('data-listen', 'true').vali(function (data) {
|
||||||
var call = form.dataset.callable || '_default_callable';
|
var type = form.method || 'POST', href = form.action || location.href;
|
||||||
var type = form.method || 'POST', tips = form.dataset.tips || undefined;
|
var call = window[form.dataset.callable || '_default_callable'] || undefined;
|
||||||
var time = form.dataset.time || undefined, href = form.action || location.href;
|
var tips = form.dataset.tips || undefined, time = form.dataset.time || undefined;
|
||||||
$.form.load(href, data, type, window[call] || undefined, true, tips, time);
|
(function (confirm, callable) {
|
||||||
|
confirm ? $.msg.confirm(confirm, callable) : callable();
|
||||||
|
})(form.dataset.confirm, function () {
|
||||||
|
$.form.load(href, data, type, call, true, tips, time);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user