more tweaks to selection javascript but still has select all bug
This commit is contained in:
		
							parent
							
								
									3dd7468365
								
							
						
					
					
						commit
						4435d957fc
					
				
					 1 changed files with 1 additions and 10 deletions
				
			
		|  | @ -62,10 +62,6 @@ | ||||||
|                 var options = $.extend({}, $.fn.actions.defaults, opts); |                 var options = $.extend({}, $.fn.actions.defaults, opts); | ||||||
|                 var actionCheckboxes = $(this); |                 var actionCheckboxes = $(this); | ||||||
|                 checker = function(checked) { |                 checker = function(checked) { | ||||||
|                     if (checked) { |  | ||||||
|                     } else { |  | ||||||
|                         reset(); |  | ||||||
|                     } |  | ||||||
|                     $(actionCheckboxes).attr("checked", checked) |                     $(actionCheckboxes).attr("checked", checked) | ||||||
|                         .parent().parent().toggleClass(options.selectedClass, checked); |                         .parent().parent().toggleClass(options.selectedClass, checked); | ||||||
|                 } |                 } | ||||||
|  | @ -81,17 +77,12 @@ | ||||||
|                         return value; |                         return value; | ||||||
|                     }); |                     }); | ||||||
|                 } |                 } | ||||||
|                 reset = function() { |  | ||||||
|                     $(options.counterContainer).show(); |  | ||||||
|                 } |  | ||||||
|                 // Show counter by default |  | ||||||
|                 $(options.counterContainer).show(); |  | ||||||
|                 // Check state of checkboxes and reinit state if needed |                 // Check state of checkboxes and reinit state if needed | ||||||
|                 $(this).filter(":checked").each(function(i) { |                 $(this).filter(":checked").each(function(i) { | ||||||
|                     $(this).parent().parent().toggleClass(options.selectedClass); |                     $(this).parent().parent().toggleClass(options.selectedClass); | ||||||
|                     updateCounter(); |                     updateCounter(); | ||||||
|                 }); |                 }); | ||||||
|                 $(options.allToggle).show().click(function() { |                 $(options.allToggle).click(function() { | ||||||
|                     checker($(this).attr("checked")); |                     checker($(this).attr("checked")); | ||||||
|                     updateCounter(); |                     updateCounter(); | ||||||
|                 }); |                 }); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 James Tauber
						James Tauber