You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2012/07/04 10:18:10 UTC

svn commit: r1357163 - in /myfaces/tobago/trunk: ./ tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-popup.js

Author: lofwyr
Date: Wed Jul  4 08:18:09 2012
New Revision: 1357163

URL: http://svn.apache.org/viewvc?rev=1357163&view=rev
Log:
TOBAGO-1169: Focus in Popup sometimes doesn't work properly in IE8 
Merged from tobago-1.5.x [from revision 1357124]

Modified:
    myfaces/tobago/trunk/   (props changed)
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-popup.js

Propchange: myfaces/tobago/trunk/
------------------------------------------------------------------------------
  Merged /myfaces/tobago/branches/tobago-1.5.x:r1357124

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-popup.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-popup.js?rev=1357163&r1=1357162&r2=1357163&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-popup.js (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-popup.js Wed Jul  4 08:18:09 2012
@@ -126,7 +126,14 @@ Tobago.Popup.lockBehind = function (popu
     // find the first element in the popup for the focus
     if (firstPopupElement != null) {
       try {
-        firstPopupElement.focus();
+        if (jQuery.browser.msie && parseInt(jQuery.browser.version) <= 8) {
+          // call the focus asynchronous, because of a bug in IE 6, 7, 8 (IE 9 works fine)
+          var focusId = firstPopupElement.attr("id");
+          var selector = Tobago.Utils.escapeClientId(focusId).replace(/\\/g, '\\\\');
+          window.setTimeout("jQuery('" + selector + "').focus()", 0);
+        } else {
+          firstPopupElement.focus();
+        }
       } catch (e) {/* ignore */
         LOG.warn("tried to setting the focus on'" + this + "'." + e); // @DEV_ONLY
       }