修改BUG:登陆窗口没有tips脚本

This commit is contained in:
Argo-Lenovo 2016-11-27 17:57:59 +08:00
parent 758c1e906d
commit abf62de0cc
1 changed files with 8 additions and 5 deletions

View File

@ -146,19 +146,22 @@
rules: $.extend({}, rules), rules: $.extend({}, rules),
messages: $.extend({}, messages), messages: $.extend({}, messages),
highlight: function (element, errorClass, validClass) { highlight: function (element, errorClass, validClass) {
$(element).parents('.form-group').addClass(errorClass).removeClass(validClass); var $ele = $(element);
$(element).tipso({ $ele.parents('.form-group').addClass(errorClass).removeClass(validClass);
if ($ele.hasClass('tipso_style')) $ele.tipso({
useTitle: false, useTitle: false,
position: 'top', position: 'top',
background: '#a94442' background: '#a94442'
}); });
}, },
unhighlight: function (element, errorClass, validClass) { unhighlight: function (element, errorClass, validClass) {
$(element).parents('.form-group').removeClass(errorClass).addClass(validClass); var $ele = $(element);
$(element).tipso('hide').tipso('destroy'); $ele.parents('.form-group').removeClass(errorClass).addClass(validClass);
if ($ele.hasClass('tipso_style')) $ele.tipso('hide').tipso('destroy');
}, },
errorPlacement: function (label, element) { errorPlacement: function (label, element) {
$(element).tipso('update', 'content', $(label).text()); var $ele = $(element);
if ($ele.hasClass('tipso_style')) $ele.tipso('update', 'content', $(label).text());
} }
}); });
if (handler && $.isArray(handler.button)) { if (handler && $.isArray(handler.button)) {