X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/2e8ce008611246347f9682d81e8fabf015765bf5..d59576d22d6c7720c0078b3e17232c81bbaf9373:/js/jquery.checkall.js diff --git a/js/jquery.checkall.js b/js/jquery.checkall.js index 4b5304965..5556d7ad7 100644 --- a/js/jquery.checkall.js +++ b/js/jquery.checkall.js @@ -1,18 +1,17 @@ /* * jQuery SelectAll plugin 1.1 * - * Copyright (c) 2009 Sven Schöling + * Copyright (c) 2009 Sven Schöling */ ;(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')); }); } });