From 57b977d781d49eb94eb4eadf543cf7aa35148b50 Mon Sep 17 00:00:00 2001 From: markjaquith Date: Thu, 5 Jul 2012 14:08:20 +0000 Subject: [PATCH] Uncheck the "select all" checkbox when one of the child checkboxes is manually unchecked. props SergeyBiryukov. fixes #20261 git-svn-id: http://core.svn.wordpress.org/trunk@21209 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/js/common.dev.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wp-admin/js/common.dev.js b/wp-admin/js/common.dev.js index e839327f0f..d3d9e70019 100644 --- a/wp-admin/js/common.dev.js +++ b/wp-admin/js/common.dev.js @@ -275,6 +275,13 @@ $(document).ready( function() { } } lastClicked = this; + + // toggle "check all" checkboxes + var unchecked = $(this).closest('tbody').find(':checkbox').filter(':visible').not(':checked'); + $(this).closest('table').children('thead, tfoot').find(':checkbox').prop('checked', function() { + return ( 0 == unchecked.length ); + }); + return true; });