Author: vmolotkov
Date: 2008-07-01 06:48:58 -0400 (Tue, 01 Jul 2008)
New Revision: 9312
Modified:
trunk/ui/hotKey/src/main/resources/org/richfaces/renderkit/html/scripts/jquery.hotkeys.js
Log:
http://jira.jboss.com/jira/browse/RF-3810
Modified:
trunk/ui/hotKey/src/main/resources/org/richfaces/renderkit/html/scripts/jquery.hotkeys.js
===================================================================
---
trunk/ui/hotKey/src/main/resources/org/richfaces/renderkit/html/scripts/jquery.hotkeys.js 2008-07-01
07:14:44 UTC (rev 9311)
+++
trunk/ui/hotKey/src/main/resources/org/richfaces/renderkit/html/scripts/jquery.hotkeys.js 2008-07-01
10:48:58 UTC (rev 9312)
@@ -93,7 +93,7 @@
// 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 || opt.checkParent){
+ /*if (jQuery.browser.opera || jQuery.browser.safari || opt.checkParent){
while (!that.all[that._checkUniqueID(element)] &&
element.parentNode){
element = element.parentNode;
}
@@ -119,7 +119,48 @@
event.preventDefault();
return false;
}
+ }*/
+ var validateMapPoint = function(element, type, special, character,cbMap) {
+ if(!shift && !ctrl && !alt) { // No Modifiers
+ var mapPoint = cbMap[special] || cbMap[character]
+ } else {
+ // deals with combinaitons (alt|ctrl|shift+anything)
+ var modif = '';
+ if(alt) modif +='alt+';
+ if(ctrl) modif+= 'ctrl+';
+ if(shift) modif += 'shift+';
+ // modifiers + special keys or modifiers + characters or modifiers + shift
characters
+ var mapPoint = cbMap[modif+special] || cbMap[modif+character] ||
cbMap[modif+that.shift_nums[character]]
+ }
+ return mapPoint;
+ };
+ // 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 (that.all[that._checkUniqueID(element)]) {
+ var cbMap =
that.all[that._checkUniqueID(element)].events[type].callbackMap;
+ mapPoint = validateMapPoint(element, type, special, character,cbMap);
}
+
+ if (jQuery.browser.opera || jQuery.browser.safari || opt.checkParent){
+ while ((element && element.parentNode &&
!that.all[that._checkUniqueID(element)]) || (!mapPoint && element.parentNode)){
+ element = element.parentNode;
+ if (that.all[that._checkUniqueID(element)]) {
+ var cbMap =
that.all[that._checkUniqueID(element)].events[type].callbackMap;
+ mapPoint = validateMapPoint(element, type, special, character,cbMap);
+ }
+ }
+ }
+
+ if (mapPoint){
+ mapPoint.cb(event);
+ if(!mapPoint.propagate) {
+ event.stopPropagation();
+ event.preventDefault();
+ return false;
+ }
+ }
};
var targetData = this._uniqueID(opt.target);