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 09:38:52 UTC
svn commit: r1357124 -
/myfaces/tobago/branches/tobago-1.5.x/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 07:38:51 2012
New Revision: 1357124
URL: http://svn.apache.org/viewvc?rev=1357124&view=rev
Log:
TOBAGO-1169: Focus in Popup sometimes doesn't work properly in IE8
Modified:
myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-popup.js
Modified: myfaces/tobago/branches/tobago-1.5.x/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/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-popup.js?rev=1357124&r1=1357123&r2=1357124&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-popup.js (original)
+++ myfaces/tobago/branches/tobago-1.5.x/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-popup.js Wed Jul 4 07:38:51 2012
@@ -122,7 +122,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
}