[richfaces-svn-commits] JBoss Rich Faces SVN: r730 - trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts.
richfaces-svn-commits at lists.jboss.org
richfaces-svn-commits at lists.jboss.org
Fri May 11 05:42:51 EDT 2007
Author: sergeyhalipov
Date: 2007-05-11 05:42:50 -0400 (Fri, 11 May 2007)
New Revision: 730
Modified:
trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
Log:
Temporary roll back changes with disabling focus on main page.
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-05-11 09:09:03 UTC (rev 729)
+++ trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2007-05-11 09:42:50 UTC (rev 730)
@@ -252,7 +252,7 @@
},
show: function(opts) {
- this.disableDocumentFocusElements();
+ //this.disableDocumentFocusElements();
this.onSelectStartHandler = document.onselectstart;
@@ -418,7 +418,7 @@
},
hide: function() {
- this.enableDocumentFocusElements();
+ //this.enableDocumentFocusElements();
document.onselectstart = this.onSelectStartHandler;
@@ -566,111 +566,6 @@
}
return vetoes;
- },
-
- isInMP: function(elem) {
- while (elem && elem.parentNode && elem.parentNode.tagName.toLowerCase() != "body")
- if (elem.parentNode.id == this.cdiv.id)
- return true;
- else
- elem = elem.parentNode;
- return false;
- },
-
- disableDocumentFocusElements: function() {
- var links = document.getElementsByTagName("a");
- var forms = document.forms;
- var inputs = document.getElementsByTagName("input");
- if (inputs) {
- for (var i=0; i<inputs.length; i++)
- // inputs with type "image" are not included to form.elements array.
- // We have to process them separately :(
- if (!this.isInMP(inputs[i]) && inputs[i].type && inputs[i].type.indexOf("image") == 0) {
- if (inputs[i].tabIndex)
- inputs[i].prevTabIndex = inputs[i].tabIndex;
- inputs[i].tabIndex = -1;
- if ("FF" == RichFaces.navigatorType() || "OPERA" == RichFaces.navigatorType()) {
- inputs[i].forceBlur = this.blurFocusElement.bindAsEventListener(inputs[i]);
- Event.observe(inputs[i], 'focus', inputs[i].forceBlur, false);
- }
- }
- }
- if (links)
- for (var i=0; i<links.length; i++)
- if (!this.isInMP(links[i])) {
- if (links[i].tabIndex)
- links[i].prevTabIndex = links[i].tabIndex;
- links[i].tabIndex = -1;
- if ("FF" == RichFaces.navigatorType() || "OPERA" == RichFaces.navigatorType()) {
- links[i].forceBlur = this.blurFocusElement.bindAsEventListener(links[i]);
- Event.observe(links[i], 'focus', links[i].forceBlur, false);
- }
- }
- if (forms)
- for (var i=0; i<forms.length; i++)
- for (var j=0; j<forms[i].length; j++)
- if (!this.isInMP(forms[i][j])) {
- if (forms[i][j].tabIndex)
- forms[i][j].prevTabIndex = forms[i][j].tabIndex;
- forms[i][j].tabIndex = -1;
- if (forms[i][j].type && forms[i][j].type.indexOf("radio") == 0) {
- forms[i][j].prevDisabled = forms[i][j].disabled;
- forms[i][j].disabled = true;
- }
- if ("FF" == RichFaces.navigatorType() || "OPERA" == RichFaces.navigatorType()) {
- forms[i][j].forceBlur = this.blurFocusElement.bindAsEventListener(forms[i][j]);
- Event.observe(forms[i][j], 'focus', forms[i][j].forceBlur, false);
- }
- }
- },
-
- enableDocumentFocusElements: function() {
- var links = document.getElementsByTagName("a");
- var forms = document.forms;
- var inputs = document.getElementsByTagName("input");
- if (inputs)
- for (var i=0; i<inputs.length; i++)
- // inputs with type "image" are not included to form.elements array.
- // We have to process them separately :(
- if (!this.isInMP(inputs[i]) && inputs[i].type && inputs[i].type.indexOf("image") == 0) {
- if (inputs[i].prevTabIndex)
- inputs[i].tabIndex = inputs[i].prevTabIndex;
- else
- inputs[i].tabIndex = 0;
- if ("FF" == RichFaces.navigatorType() || "OPERA" == RichFaces.navigatorType())
- Event.stopObserving(inputs[i], "focus", inputs[i].forceBlur);
- }
- if (links)
- for (var i=0; i<links.length; i++)
- if (!this.isInMP(links[i])) {
- if (links[i].prevTabIndex)
- links[i].tabIndex = links[i].prevTabIndex;
- else
- links[i].tabIndex = 0;
- if ("FF" == RichFaces.navigatorType() || "OPERA" == RichFaces.navigatorType())
- Event.stopObserving(links[i], "focus", links[i].forceBlur);
- }
- if (forms)
- for (var i=0; i<forms.length; i++)
- for (var j=0; j<forms[i].length; j++)
- if (!this.isInMP(forms[i][j])) {
- if (forms[i][j].prevTabIndex)
- forms[i][j].tabIndex = forms[i][j].prevTabIndex;
- else
- forms[i][j].tabIndex = 0;
- if (forms[i][j].type && forms[i][j].type.indexOf("radio") == 0) {
- if (forms[i][j].prevDisabled)
- forms[i][j].disabled = forms[i][j].prevDisabled;
- else
- forms[i][j].disabled = false;
- }
- if ("FF" == RichFaces.navigatorType() || "OPERA" == RichFaces.navigatorType())
- Event.stopObserving(forms[i][j], "focus", forms[i][j].forceBlur);
- }
- },
-
- blurFocusElement: function() {
- this.blur();
}
}
More information about the richfaces-svn-commits
mailing list