X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=js%2Fjquery.checkall.js;h=5556d7ad77693aee0ec80d9feb79ff9f62c387fd;hb=f044d58d95464652f923f0c27d74566f72c1fb47;hp=4b530496561d9240a51fee38cedcee9a82cdd130;hpb=2e8ce008611246347f9682d81e8fabf015765bf5;p=kivitendo-erp.git 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')); }); } });