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

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Thu Aug 2 04:43:28 EDT 2007


Author: A.Skokov
Date: 2007-08-02 04:43:27 -0400 (Thu, 02 Aug 2007)
New Revision: 2002

Modified:
   trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
Log:
http://jira.jboss.com/jira/browse/RF-528

Modified: trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
===================================================================
--- trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js	2007-08-02 03:14:49 UTC (rev 2001)
+++ trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js	2007-08-02 08:43:27 UTC (rev 2002)
@@ -92,10 +92,10 @@
 
 		this.onScrollListener = this.onScroll.bindAsEventListener(this);
 
-		if (options.popupClass)		
+		if (options.popupClass)
 			Element.addClassName(document.getElementsByClassName("dr-sb-ext-decor-3",
 											this.update)[0], options.popupClass);
-											
+
 		this.onNothingLabelClick = this.hideNLabel.bindAsEventListener(this);
     },
 
@@ -164,7 +164,7 @@
         if (Element.getStyle(this.update, 'display')
                 == 'none') this.options.onShow(this.element, this.update, this.options);
         this.disableSubmit();
-        
+
     },
 
     hide: function() {
@@ -182,7 +182,7 @@
 		this.hasFocus = false;
         this.active = false;
     },
-    
+
     hideNLabel: function(event) {
 	var nothingLabel = $(this.update.id + "NothingLabel");
     	if (nothingLabel) {
@@ -283,7 +283,7 @@
                         this.prevOnKeyPress = this.element.onkeypress;
                         this.element.onkeypress
                                 = this.onBoxKeyPress.bindAsEventListener(this);
-                    } 
+                    }
                     return;
                 case 34:
                     this.keyEvent = true;
@@ -296,7 +296,7 @@
                         this.prevOnKeyPress = this.element.onkeypress;
                         this.element.onkeypress
                                 = this.onBoxKeyPress.bindAsEventListener(this);
-                    } 
+                    }
                     return;
             }
         } else if (event.keyCode == Event.KEY_TAB
@@ -430,9 +430,9 @@
 		var entry = this.getEntry(this.index);
         var scroll = document.getElementsByClassName("_suggestion_size_", this.update)[0]
                 || this.update;
-                
+
 		var entryPosition = this.calcEntryPosition(entry,scroll);
-		
+
 		var countAll = Math.round(scroll.clientHeight/entryPosition.entryOffsetHeight);
 		var current = Math.round((entryPosition.realOffset-scroll.scrollTop)/entryPosition.entryOffsetHeight);
 		return {current:current,all:countAll};
@@ -446,17 +446,17 @@
                 var entry = this.getEntry(this.index);
                 for (var i = 0; i < this.options.selectedClasses.length; i++)
 	                Element.addClassName(entry, this.options.selectedClasses[i]);
-                
+
                 var cells = document.getElementsByClassName("dr-sb-cell-padding" , entry);
                 for (var i = 0; i < cells.length; i++) {
                 	Element.addClassName(cells[i], this.options.selectValueClass);
                 }
-                
+
                 // Calc scroll position :
                 if (this.keyEvent) {
 	                var scroll = document.getElementsByClassName("_suggestion_size_", this.update)[0]
 	                        || this.update;
-			
+
 					var entryPosition = this.calcEntryPosition(entry,scroll);
 
 					var oldScrollTop = scroll.scrollTop;
@@ -483,9 +483,9 @@
                     }
                 }
             }
-            
+
             this.prevIndex = this.index;
-            if (this.hasFocus) {
+            if (this.hasFocus && !this.wasBlur) {
                 this.show();
                 this.active = true;
             }




More information about the richfaces-svn-commits mailing list