]> wagnertech.de Git - kivitendo-erp.git/blobdiff - js/jquery.checkall.js
kivi.validate_form: generische Formvalidierung anhand von data-Attributen an Elementen
[kivitendo-erp.git] / js / jquery.checkall.js
index cef64ef8bb9ec4097bba2e1ec4bcf65382e93d57..5556d7ad77693aee0ec80d9feb79ff9f62c387fd 100644 (file)
@@ -1,17 +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, property) {
+  checkall: function(target, property, inverted) {
     if (property == null)
       property = 'checked';
     return $(this).click(function() {
-      $(target).prop(property, $(this).prop('checked'));
+      $(target).prop(property, inverted ? !$(this).prop('checked') : $(this).prop('checked'));
     });
   }
 });