From 3fc7495aca073404c1b143e9426831fcba0ee0a2 Mon Sep 17 00:00:00 2001 From: azaozz Date: Fri, 3 Aug 2012 21:47:58 +0000 Subject: [PATCH] Quicktags: don't call the callback on pressing the access key when a button is not visible, see #21460 git-svn-id: http://core.svn.wordpress.org/trunk@21418 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/js/quicktags.dev.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wp-includes/js/quicktags.dev.js b/wp-includes/js/quicktags.dev.js index 3759c90c19..cb4d2bee07 100644 --- a/wp-includes/js/quicktags.dev.js +++ b/wp-includes/js/quicktags.dev.js @@ -182,7 +182,11 @@ function edButton(id, display, tagStart, tagEnd, access, open) { // listen for click events onclick = function(e) { e = e || window.event; - var target = e.target || e.srcElement, i; + var target = e.target || e.srcElement, visible = target.clientWidth || target.offsetWidth, i; + + // don't call the callback on pressing the accesskey when the button is not visible + if ( !visible ) + return; // as long as it has the class ed_button, execute the callback if ( / ed_button /.test(' ' + target.className + ' ') ) {