You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2008/01/23 21:53:20 UTC

svn commit: r614659 - in /myfaces/tobago/branches/tobago-1.0.x: ./ theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/

Author: bommel
Date: Wed Jan 23 12:53:12 2008
New Revision: 614659

URL: http://svn.apache.org/viewvc?rev=614659&view=rev
Log:
Merged revisions 614291 via svnmerge from 
https://svn.apache.org/repos/asf/myfaces/tobago/trunk

........
  r614291 | bommel | 2008-01-22 20:28:52 +0100 (Di, 22 Jan 2008) | 3 lines
  
  (TOBAGO-539) Accelerator keys don't work properly in tabGroup
  
  Thanks Helmut Swaczinna
........

Modified:
    myfaces/tobago/branches/tobago-1.0.x/   (props changed)
    myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tabgroup.js
    myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js

Propchange: myfaces/tobago/branches/tobago-1.0.x/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Jan 23 12:53:12 2008
@@ -1 +1 @@
-/myfaces/tobago/trunk:1-603371,609568-609629,612250-612251,612282,612518,613455,613939,614278
+/myfaces/tobago/trunk:1-603371,609568-609629,612250-612251,612282,612518,613455,613939,614278,614291

Modified: myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tabgroup.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tabgroup.js?rev=614659&r1=614658&r2=614659&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tabgroup.js (original)
+++ myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tabgroup.js Wed Jan 23 12:53:12 2008
@@ -119,7 +119,7 @@
 };
 
 Tobago.TabGroup.prototype.removeRelatedAcceleratorKeys = function(idPrefix) {
-    var regex = new RegExp("Tobago.clickOnElement\\(\"" + idPrefix);
+    var regex = new RegExp("Tobago.clickOnElement\\([\"']" + idPrefix);
     for (var name in Tobago.acceleratorKeys) {
       if (typeof Tobago.acceleratorKeys[name] == 'object'
           && typeof Tobago.acceleratorKeys[name].func == 'function'

Modified: myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js?rev=614659&r1=614658&r2=614659&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js (original)
+++ myfaces/tobago/branches/tobago-1.0.x/theme/standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago.js Wed Jan 23 12:53:12 2008
@@ -154,6 +154,12 @@
     },
 
     remove: function(keyAccelerator) {
+      if (keyAccelerator.ieHelperElementId != null) {
+        var ieHelperElement = document.getElementById(keyAccelerator.ieHelperElementId);
+        if (ieHelperElement != null) {
+          ieHelperElement.parentNode.removeChild(ieHelperElement);
+        }
+      }
       var key = keyAccelerator.modifier + keyAccelerator.key;
       if (this[key]) {
 //        LOG.debug("delete accelerator for " + keyAccelerator.modifier + "-" + keyAccelerator.key);
@@ -1601,12 +1607,14 @@
     if (modifier == "alt") {
       // can't make document.createElement("span").accesskey = key working
       // so need to create an element via innerHTML
+      this.ieHelperElementId = "ieHelperElement_" + modifier + key;
       var span = document.createElement("span");
       document.body.appendChild(span);
-      var aPrefix = "<a href=\"javascript:;\" tabindex=\"-1\" accesskey=\"";
+      var aPrefix = "<a id=\"" + this.ieHelperElementId + "\" href=\"javascript:;\" tabindex=\"-1\" accesskey=\"";
       var aPostfix = "\" onclick=\"return false;\" ></a>";
       span.innerHTML = aPrefix + key.toLowerCase() + aPostfix;
       span.firstChild.attachEvent("onfocus", function(event) {func(event);});
+      Tobago.acceleratorKeys.set(this);
     } else {
       LOG.warn("Cannot observe key event for "  + modifier + "-" + key);
     }