Fix comment hotkeys for FF and IE. Props azaozz, SergeyBiryukov. fixes #20885

git-svn-id: https://develop.svn.wordpress.org/trunk@21035 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2012-06-09 15:57:11 +00:00
parent 903e720df8
commit c65db79290
1 changed files with 7 additions and 4 deletions

View File

@ -51,10 +51,12 @@ USAGE:
// inspect if keystroke matches
var inspector = function(event) {
event = jQuery.event.fix(event); // jQuery event normalization.
// WP: not needed with newer jQuery
// event = jQuery.event.fix(event); // jQuery event normalization.
var element = event.target;
// @ TextNode -> nodeType == 3
element = (element.nodeType==3) ? element.parentNode : element;
// WP: not needed with newer jQuery
// element = (element.nodeType==3) ? element.parentNode : element;
if(opt['disableInInput']) { // Disable shortcut keys in Input, Textarea fields
var target = jQuery(element);
@ -76,11 +78,12 @@ USAGE:
// in opera + safari, the event.target is unpredictable.
// for example: 'keydown' might be associated with HtmlBodyElement
// or the element where you last clicked with your mouse.
if (jQuery.browser.opera || jQuery.browser.safari){
// WP: needed for all browsers
// if (jQuery.browser.opera || jQuery.browser.safari){
while (!that.all[element] && element.parentNode){
element = element.parentNode;
}
}
// }
var cbMap = that.all[element].events[type].callbackMap;
if(!shift && !ctrl && !alt && !meta) { // No Modifiers
mapPoint = cbMap[special] || cbMap[character]