From: <blu...@us...> - 2007-08-08 15:56:43
|
Revision: 3474 http://j-wings.svn.sourceforge.net/j-wings/?rev=3474&view=rev Author: blueshift Date: 2007-08-08 08:56:41 -0700 (Wed, 08 Aug 2007) Log Message: ----------- o Fix kindly provided from Hans As you can see, the component which requested the focus is stored in variable div. then some checks are done. At last, it is checked if the element is disabled (works) or not displayed (doesn't work). This always fails because of operator precedence in javascript. ! has higher priority than ==. So we need to change check: if (!div.disabled && div.style.display != "none") Modified Paths: -------------- wings2/branches/2.x/src/res/org/wings/plaf/css/wings.js Modified: wings2/branches/2.x/src/res/org/wings/plaf/css/wings.js =================================================================== --- wings2/branches/2.x/src/res/org/wings/plaf/css/wings.js 2007-08-07 16:41:16 UTC (rev 3473) +++ wings2/branches/2.x/src/res/org/wings/plaf/css/wings.js 2007-08-08 15:56:41 UTC (rev 3474) @@ -167,7 +167,7 @@ window.focus = id; if (div) { if (div.getAttribute("foc") == id) { - if (!div.disabled && !div.style.display == "none") + if (!div.disabled && div.style.display != "none") div.focus(); return; } @@ -175,7 +175,7 @@ var elements = div.getElementsByTagName("INPUT"); for (var i = 0; i < elements.length; i++) { var element = elements[i]; - if (element.getAttribute("foc") == id && !element.disabled && !element.style.display == "none") { + if (element.getAttribute("foc") == id && !element.disabled && element.style.display != "none") { element.focus(); return; } @@ -183,7 +183,7 @@ elements = div.getElementsByTagName("A"); for (var i = 0; i < elements.length; i++) { var element = elements[i]; - if (element.getAttribute("foc") == id && !element.disabled && !element.style.display == "none") { + if (element.getAttribute("foc") == id && !element.disabled && element.style.display != "none") { element.focus(); return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |