[start page] support 'link' element in 'disable' method

This commit is contained in:
Maxim Kadushkin
2018-10-09 16:53:17 +03:00
parent 7cf883f375
commit 0dec69b6aa

View File

@ -39,11 +39,14 @@
$.fn.extend({
disable: function(state) {
$(this).prop('disabled', state);
if ( this.is('a') ) {
state ? this.attr('disabled', 'disabled') : this.removeAttr('disabled');
} else $(this).prop('disabled', state);
return this;
},
isdisabled: function() {
return !!$(this).prop('disabled');
return !this.is('a') ? !!$(this).prop('disabled') : !!this.attr('disabled');
}
});
})(jQuery);