From 927094d296e28a7c1a8479976095e737483ab8ab Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Fri, 5 Dec 2008 08:01:10 +0000 Subject: [PATCH] Prevent hotkeys from clicking hidden links -- keeps U and A from both acting as moderated/approved toggles. Now each one just does its own function. git-svn-id: https://develop.svn.wordpress.org/trunk@10065 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/js/wp-lists.js | 2 ++ wp-includes/script-loader.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/js/wp-lists.js b/wp-includes/js/wp-lists.js index 640663c691..128cf157a2 100644 --- a/wp-includes/js/wp-lists.js +++ b/wp-includes/js/wp-lists.js @@ -175,6 +175,8 @@ var wpList = { }, ajaxDim: function( e, s ) { + if ( $(e).parent().css('display') == 'none' ) // Prevent hidden links from being clicked by hotkeys + return false; var list = this; e = $(e); s = s || {}; var cls = wpList.parseClass(e,'dim'); s = wpList.pre.call( list, e, s, 'dim' ); diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 72663f5abc..3557666fe5 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -77,7 +77,7 @@ function wp_default_scripts( &$scripts ) { $scripts->add( 'autosave', '/wp-includes/js/autosave.js', array('schedule', 'wp-ajax-response'), '20081110' ); - $scripts->add( 'wp-lists', '/wp-includes/js/wp-lists.js', array('wp-ajax-response'), '20081204' ); + $scripts->add( 'wp-lists', '/wp-includes/js/wp-lists.js', array('wp-ajax-response'), '20081205' ); $scripts->localize( 'wp-lists', 'wpListL10n', array( 'url' => admin_url('admin-ajax.php') ) );