Author: sergeyhalipov
Date: 2007-06-27 11:25:01 -0400 (Wed, 27 Jun 2007)
New Revision: 1344
Modified:
trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
trunk/richfaces/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
Log:
Some improvements for RF-46.
Modified:
trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
===================================================================
---
trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2007-06-27
15:24:39 UTC (rev 1343)
+++
trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2007-06-27
15:25:01 UTC (rev 1344)
@@ -288,9 +288,9 @@
return false;
},
- processTabindexes: function(inputs, tabindex) {
- if (!inputs || !tabindex || !inputs.length)
- return tabindex;
+ processTabindexes: function(inputs) {
+ if (!inputs || !inputs.length)
+ return ;
for (var i = 0; i < inputs.length; i++) {
if (!this.isInModalPanel(inputs[i])) {
if (!this.firstOutside)
@@ -298,16 +298,14 @@
this.lastOutside = inputs[i];
if (inputs[i].tabIndex) {
inputs[i].prevTabIndex = inputs[i].tabIndex;
- inputs[i].tabIndex = tabindex;
}
+ inputs[i].tabIndex = null;
if (inputs[i].accesskey) {
inputs[i].prevAccesskey = inputs[i].accesskey;
- inputs[i].accesskey = undefined;
}
- tabindex--;
+ inputs[i].accesskey = undefined;
}
}
- return tabindex;
},
restoreTabindexes: function(inputs) {
@@ -315,24 +313,23 @@
return;
for (var i = 0; i < inputs.length; i++) {
if (!this.isInModalPanel(inputs[i])) {
- if (inputs[i].prevTabIndex)
- inputs[i].tabIndex = inputs[i].prevTabIndex;
- if (inputs[i].prevAccesskey)
- inputs[i].accesskey = inputs[i].prevAccesskey;
+ inputs[i].tabIndex = inputs[i].prevTabIndex;
+ inputs[i].accesskey = inputs[i].prevAccesskey;
}
}
},
preventFocus: function() {
- var tabindex = 32768;
var inputs = document.getElementsByTagName("input");
- tabindex = this.processTabindexes(inputs, tabindex);
+ this.processTabindexes(inputs);
var selects = document.getElementsByTagName("select");
- tabindex = this.processTabindexes(selects, tabindex);
+ this.processTabindexes(selects);
var buttons = document.getElementsByTagName("button");
- tabindex = this.processTabindexes(buttons, tabindex);
+ this.processTabindexes(buttons);
var hrefs = document.getElementsByTagName("a");
- tabindex = this.processTabindexes(hrefs, tabindex);
+ this.processTabindexes(hrefs);
+ var texts = document.getElementsByTagName("textarea");
+ this.processTabindexes(texts);
if (this.firstOutside) {
Event.observe(this.firstOutside, "focus", this.eventFirstOnfocus);
@@ -340,8 +337,6 @@
if (this.lastOutside) {
Event.observe(this.lastOutside, "focus", this.eventLastOnfocus);
}
- if (RichFaces.navigatorType() != "MSIE")
- this.lastOnfocus();
},
restoreFocus: function() {
@@ -353,6 +348,8 @@
this.restoreTabindexes(buttons);
var hrefs = document.getElementsByTagName("a");
this.restoreTabindexes(hrefs);
+ var texts = document.getElementsByTagName("textarea");
+ this.restoreTabindexes(texts);
if (this.firstOutside) {
Event.stopObserving(this.firstOutside, "focus", this.eventFirstOnfocus);
@@ -516,6 +513,8 @@
var event = {};
event.parameters = opts || {};
if (this.eventOnShow) this.eventOnShow(event);
+
+ this.lastOnfocus();
},
startDrag: function(border) {
Modified:
trunk/richfaces/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
===================================================================
---
trunk/richfaces/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2007-06-27
15:24:39 UTC (rev 1343)
+++
trunk/richfaces/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2007-06-27
15:25:01 UTC (rev 1344)
@@ -73,9 +73,9 @@
<div style="position: absolute; overflow: hidden; z-index: 2;"
class="dr-mpnl-pnl" id="#{clientId}ContentDiv">
-
- <table style="height: 100%; width: 100%;" border="0"
cellpadding="0" cellspacing="0">
- <a href="#" style="position: absolute; left: -32000"
id="#{clientId}FirstHref" >_</a>
+
+ <a href="#" style="position: absolute; left: -32000"
id="#{clientId}FirstHref" >_</a>
+ <table style="height: 100%; width: 100%;" border="0"
cellpadding="0" cellspacing="0">
<jsp:scriptlet>
<![CDATA[if(component.getFacet("header")!=null &&
component.getFacet("header").isRendered()) {]]>
</jsp:scriptlet>
Show replies by date