[richfaces-svn-commits] JBoss Rich Faces SVN: r11545 - trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Thu Dec 4 08:38:47 EST 2008


Author: pyaschenko
Date: 2008-12-04 08:38:46 -0500 (Thu, 04 Dec 2008)
New Revision: 11545

Modified:
   trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
Log:
https://jira.jboss.org/jira/browse/RF-3670

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-12-04 13:08:40 UTC (rev 11544)
+++ trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js	2008-12-04 13:38:46 UTC (rev 11545)
@@ -394,17 +394,17 @@
 		}
 	},
 	
-	rExpFormElements : /^(?:a|input|select|button|textarea)$/i,
-	rExpHidden : /^hidden$/,
+	formElements: "|a|input|select|button|textarea|",
 	
 	processAllFocusElements: function(root, callback) {
-		if (root.focus && 
-			// Many not visible elements have focus method, we is had to avoid processing them.
-			this.rExpFormElements.test(root.tagName) &&
-			!root.disabled && !this.rExpHidden.test(root.type) &&
-			root.style.display != 'none') {
-
-				callback.call(this, root);
+		if (root.nodeType==1) {
+			var tagName = root.tagName.toLowerCase();
+			if (root.focus && 
+				// Many not visible elements have focus method, we is had to avoid processing them.
+				this.formElements.indexOf(tagName)!=-1 &&
+				!root.disabled && root.type!="hidden") {
+					callback.call(this, root);
+			}
 		} else {
 			if (root != this.id) {
 				var child = root.firstChild;
@@ -419,7 +419,7 @@
 	},
 
 	processTabindexes:	function(input) {
-		if (!this.firstOutside && !(/^select$/i.test(input.tagName) && ModalPanel.disableSelects)) {
+		if (!this.firstOutside && !(input.tagName.toLowerCase()=="select" && ModalPanel.disableSelects)) {
 			this.firstOutside = input;
 		}
 		this.lastOutside = input;
@@ -880,7 +880,7 @@
 		var target = Event.element(e);
 		if (e && target) {
 			// Concret input but not entire form is a target element for onsubmit in FF
-			while (target && !/^form$/i.test(target.tagName)) {
+			while (target && target.tagName.toLowerCase()!="form") {
 				target = target.parentNode;
 			}
 			




More information about the richfaces-svn-commits mailing list