maposmatic-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Maposmatic-dev] [PATCH 2/2] Allow Enter to be pressed to validate the f


From: Maxime Petazzoni
Subject: [Maposmatic-dev] [PATCH 2/2] Allow Enter to be pressed to validate the form once a result has been selected
Date: Sun, 10 Jan 2010 22:08:52 +0100

---
 www/media/osm_map.js |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/www/media/osm_map.js b/www/media/osm_map.js
index e995ddf..f4cc92f 100644
--- a/www/media/osm_map.js
+++ b/www/media/osm_map.js
@@ -203,7 +203,12 @@ function suggest(input, results, osm_id, button, options) {
   }
 
   function processKey(e) {
-    clearResult();
+    if (e.keyCode != 13) {
+      clearResult();
+    } else {
+      if ($osm_id.val() != '')
+        $button.click();
+    }
 
     switch (e.keyCode) {
       case 27:  // ESC
-- 
1.6.3.3.261.g85c6





reply via email to

[Prev in Thread] Current Thread [Next in Thread]