Author: sergeyhalipov
Date: 2008-03-19 08:22:01 -0400 (Wed, 19 Mar 2008)
New Revision: 6942
Modified:
trunk/ui/modal-panel/src/main/java/org/richfaces/renderkit/ModalPanelRendererBase.java
trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
Log:
http://jira.jboss.com/jira/browse/RF-2353
Modified:
trunk/ui/modal-panel/src/main/java/org/richfaces/renderkit/ModalPanelRendererBase.java
===================================================================
---
trunk/ui/modal-panel/src/main/java/org/richfaces/renderkit/ModalPanelRendererBase.java 2008-03-19
12:19:23 UTC (rev 6941)
+++
trunk/ui/modal-panel/src/main/java/org/richfaces/renderkit/ModalPanelRendererBase.java 2008-03-19
12:22:01 UTC (rev 6942)
@@ -138,6 +138,7 @@
StringBuffer result = new StringBuffer();
if (panel.isKeepVisualState() || panel.isShowWhenRendered()) {
+ result.append("Event.observe(window, \"load\", function() {");
result.append("Richfaces.showModalPanel('" + panel.getClientId(context)
+ "', {");
Iterator it = panel.getVisualOptions().entrySet().iterator();
@@ -150,7 +151,7 @@
}
}
- result.append("});");
+ result.append("});}.bind());");
}
return result.toString();
}
Modified:
trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
===================================================================
---
trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2008-03-19
12:19:23 UTC (rev 6941)
+++
trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2008-03-19
12:22:01 UTC (rev 6942)
@@ -358,14 +358,16 @@
// Many not visible elements have focus method, we is had to avoid processing them.
/^a|input|select|button|textarea$/i.test(root.tagName) &&
!root.disabled && !/^hidden$/.test(root.type) &&
- !/^none$/.test(root.style.display)) {
+ Element.visible(root)) {
- callback.call(this, root);
+ callback.call(this, root);
} else {
if (root != this.id) {
var child = root.firstChild;
while (child) {
- this.processAllFocusElements(child, callback);
+ if (!child.style || Element.visible(child)) {
+ this.processAllFocusElements(child, callback);
+ }
child = child.nextSibling;
}
}
@@ -373,8 +375,9 @@
},
processTabindexes: function(input) {
- if (!this.firstOutside)
+ if (!this.firstOutside && !(/^select$/i.test(input.tagName) &&
ModalPanel.disableSelects)) {
this.firstOutside = input;
+ }
this.lastOutside = input;
if (input.tabIndex) {
input.prevTabIndex = input.tabIndex;