From daef59322cee0ffc65ea2dbee62edcb10233dd50 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Tue, 4 Sep 2012 20:27:14 +0000 Subject: [PATCH] Modify a few jQuery selectors to prevent overflows and lagging. Todo, rewrite wp-lists and improve all of these selectors. props SergeyBiryukov. fixes #21106 for trunk. see #21152. git-svn-id: http://core.svn.wordpress.org/trunk@21737 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/js/post.js | 2 +- wp-includes/js/wp-lists.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-admin/js/post.js b/wp-admin/js/post.js index cb369f13a5..b5c10799dc 100644 --- a/wp-admin/js/post.js +++ b/wp-admin/js/post.js @@ -342,7 +342,7 @@ jQuery(document).ready( function($) { return false; }); - $('#' + taxonomy + 'checklist li.popular-category :checkbox, #' + taxonomy + 'checklist-pop :checkbox').live( 'click', function(){ + $('#' + taxonomy + 'checklist li.popular-category input[type="checkbox"], #' + taxonomy + 'checklist-pop input[type="checkbox"]').live( 'click', function(){ var t = $(this), c = t.is(':checked'), id = t.val(); if ( id && t.parents('#taxonomy-'+taxonomy).length ) $('#in-' + taxonomy + '-' + id + ', #in-popular-' + taxonomy + '-' + id).prop( 'checked', c ); diff --git a/wp-includes/js/wp-lists.js b/wp-includes/js/wp-lists.js index 71158106f4..3954c3055e 100644 --- a/wp-includes/js/wp-lists.js +++ b/wp-includes/js/wp-lists.js @@ -397,7 +397,7 @@ wpList = { return list.wpList.add(this); }); - $el.delegate( '[class^="add:' + list.id + ':"]:not(form)', 'click', function(){ + $el.delegate( 'a[class^="add:' + list.id + ':"], input[class^="add:' + list.id + ':"]', 'click', function(){ return list.wpList.add(this); });