X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=js%2Fjquery.checkall.js;h=00798d8f3053d2a1ed54b9e3c9982c06d40f2401;hb=efb9a24f2252104ab4af5c25334119d7c5c70a8c;hp=4b530496561d9240a51fee38cedcee9a82cdd130;hpb=8cf7d0a1f3279c2f1aefae70c6d5689da5156460;p=kivitendo-erp.git diff --git a/js/jquery.checkall.js b/js/jquery.checkall.js index 4b5304965..00798d8f3 100644 --- a/js/jquery.checkall.js +++ b/js/jquery.checkall.js @@ -7,12 +7,11 @@ ;(function($) { $.fn.extend({ - checkall: function(target) { - var saved_this = this; + checkall: function(target, property, inverted) { + if (property == null) + property = 'checked'; return $(this).click(function() { - $(target).each(function() { - $(this).attr('checked', $(saved_this).attr('checked')); - }); + $(target).prop(property, inverted ? !$(this).prop('checked') : $(this).prop('checked')); }); } });