Browse Source

validation de la recherche de lieu avec la touche enter + positionnement auto du curseur sur le champ de recherche

julpec 8 years ago
parent
commit
81329b871a
1 changed files with 11 additions and 1 deletions
  1. 11 1
      panorama/templates/panorama/main.html

+ 11 - 1
panorama/templates/panorama/main.html

@@ -251,9 +251,19 @@
             map.addLayer(pointsOfInterest);
             map.fitBounds(fittingMarkers,{padding: [30, 30]});
             legend.addTo(map);
+        }
 
-
+        // Submit on enter keypress for the search module
+        $('#search').keypress(function(e){
+            if(e.which == 13) {
+                document.getElementById("search-btn").click();
             }
+        });
+        // Put cursor on the search field for dropdown search module
+        $('#search-menu').click(function () {
+            setTimeout(function(){$('#search').focus();},0);
+        });
+
         initmap();
 
         accordionMenus();