增加验证控件脚本兼容性

This commit is contained in:
Argo-Surface 2017-01-14 17:23:51 +08:00 committed by Argo-Lenovo
parent 363b055685
commit 717d29f028
1 changed files with 4 additions and 1 deletions

View File

@ -241,6 +241,9 @@
that.animate({ marginTop: "+=" + getHeight() });
},
autoValidate: function (rules, messages, handler) {
var parent = 'body';
var $wrapper = $('#dialogNew');
if ($wrapper.length == 1) parent = '#dialogNew';
// validate
var $this = $(this);
if (messages && $.isArray(messages.button)) {
@ -264,7 +267,7 @@
},
errorPlacement: function (label, element) {
var $ele = $(element);
if (!$ele.attr('data-original-title')) $ele.tooltip({ container: '#dialogNew', delay: { "show": 500, "hide": 100 } });
if (!$ele.attr('data-original-title')) $ele.tooltip({ container: parent, delay: { "show": 500, "hide": 100 } });
$ele.attr('data-original-title', $(label).text());
$ele.tooltip('show')
}