MidCOM svn: r15215 - trunk/midcom/midcom.helper.datamanager2/static/chooser

flack midcom-commits at lists.midgard-project.org
Sat Feb 23 18:46:45 CET 2008


Author: flack
Date: Sat Feb 23 18:46:44 2008
New Revision: 15215
URL: http://trac.midgard-project.org/software/changeset/15215

Log:
forward port r15214

Modified:
   trunk/midcom/midcom.helper.datamanager2/static/chooser/jquery.chooser_widget.js

Modified: trunk/midcom/midcom.helper.datamanager2/static/chooser/jquery.chooser_widget.js
==============================================================================
--- trunk/midcom/midcom.helper.datamanager2/static/chooser/jquery.chooser_widget.js	(original)
+++ trunk/midcom/midcom.helper.datamanager2/static/chooser/jquery.chooser_widget.js	Sat Feb 23 18:46:44 2008
@@ -281,7 +281,7 @@
         // having fun with opera - remove this binding and Opera submits the form when we select an entry via return
         switch(event.keyCode) {
             case KEY.TAB:
-            case KEY:RETURN:
+            case KEY.RETURN:
                 event.preventDefault();
                 break;
         }
@@ -538,10 +538,10 @@
                     {
                         restore(item_id);
                     }
-	                else
-	                {
-	                    activate(item_id);
-	                }
+                    else
+                    {
+                        activate(item_id);
+                    }
                 }
 
                 return false;
@@ -552,11 +552,11 @@
             }
         })
         .mouseover( function(event) {
-        	var jq_elem = jQuery(target(event)).addClass(CLASSES.HOVER);
-    	})
-    	.mouseout( function(event) {
-        	jQuery(target(event)).removeClass(CLASSES.HOVER);
-    	});
+            var jq_elem = jQuery(target(event)).addClass(CLASSES.HOVER);
+        })
+        .mouseout( function(event) {
+            jQuery(target(event)).removeClass(CLASSES.HOVER);
+        });
         
         if (data['pre_selected'])
         {
@@ -760,8 +760,11 @@
         },
         activate_item: function(item)
         {
-            var item_id = item[options.id_field];
-            activate(item_id);
+            if(item)
+            {
+                var item_id = item[options.id_field];
+                activate(item_id);
+            }
         },
         visible : function() {
             return element.is(":visible");


More information about the midcom-commits mailing list