[OpenLayers-Commits] r11329 - sandbox/camptocamp/mobile/openlayers/examples

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Wed Feb 23 09:50:43 EST 2011


Author: pgiraud
Date: 2011-02-23 06:50:43 -0800 (Wed, 23 Feb 2011)
New Revision: 11329

Modified:
   sandbox/camptocamp/mobile/openlayers/examples/mobile-jq.js
Log:
Fixing indent and using the 'change' event for the search field

Modified: sandbox/camptocamp/mobile/openlayers/examples/mobile-jq.js
===================================================================
--- sandbox/camptocamp/mobile/openlayers/examples/mobile-jq.js	2011-02-23 14:42:54 UTC (rev 11328)
+++ sandbox/camptocamp/mobile/openlayers/examples/mobile-jq.js	2011-02-23 14:50:43 UTC (rev 11329)
@@ -40,8 +40,7 @@
             control.activate();
         }
     });
-    $('#query').keyup(function(e){
-        if (e.which === 13) { // enter
+    $('#query').bind('change', function(e){
         $.mobile.pageLoading();
 
         // Prevent form send
@@ -55,25 +54,23 @@
             $.each(data.geonames, function() {
                 var place = this;
                 $('<li>')
-                .hide()
-                .append($('<h2 />', {
-                    text: place.name
+                    .hide()
+                    .append($('<h2 />', {
+                        text: place.name
                     }))
                     .append($('<p />', {
                         html: '<b>' + place.countryName + '</b> ' + place.fcodeName
-                        }))
-                        .appendTo('#search_results')
-                        .click(function() {
-                            $.mobile.changePage('mappage');
-                            var lonlat = new OpenLayers.LonLat(place.lng, place.lat);
-                            map.setCenter(lonlat.transform(gg, sm), 10);
-                        })
-                        .show();
-                    });
-                    $('#search_results').listview('refresh');
-                    $.mobile.pageLoading(true);
-                });
-            }
-
+                    }))
+                    .appendTo('#search_results')
+                    .click(function() {
+                        $.mobile.changePage('mappage');
+                        var lonlat = new OpenLayers.LonLat(place.lng, place.lat);
+                        map.setCenter(lonlat.transform(gg, sm), 10);
+                    })
+                    .show();
+            });
+            $('#search_results').listview('refresh');
+            $.mobile.pageLoading(true);
         });
     });
+});



More information about the Commits mailing list