修改BUG:调用tipso方法前进行判断

This commit is contained in:
Argo-Lenovo 2016-11-27 19:07:32 +08:00
parent 89484ad677
commit 77add675cd
1 changed files with 2 additions and 2 deletions

View File

@ -148,7 +148,7 @@
highlight: function (element, errorClass, validClass) {
var $ele = $(element);
$ele.parents('.form-group').addClass(errorClass).removeClass(validClass);
if ($ele.hasClass('tipso_style')) $ele.tipso({
if ($.isFunction($ele.tipso)) $ele.tipso({
useTitle: false,
position: 'top',
background: '#a94442'
@ -161,7 +161,7 @@
},
errorPlacement: function (label, element) {
var $ele = $(element);
if ($ele.hasClass('tipso_style')) $ele.tipso('update', 'content', $(label).text());
if ($.isFunction($ele.tipso)) $ele.tipso('update', 'content', $(label).text());
}
});
if (handler && $.isArray(handler.button)) {