From 0e5e23b0cbb441cfdf414a5a8f2abde48468a39e Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Thu, 15 Apr 2010 17:11:04 -0400 Subject: [PATCH] Hitting enter while in the location field shouldn't submit the form. Catch KEY_RETURN in the keydownHandler, and trigger the geocode action if we are in the location field of the event form. --- kronolith/js/kronolith.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/kronolith/js/kronolith.js b/kronolith/js/kronolith.js index bc0c36a48..1ed244e70 100644 --- a/kronolith/js/kronolith.js +++ b/kronolith/js/kronolith.js @@ -3261,7 +3261,14 @@ KronolithCore = { keydownHandler: function(e) { var kc = e.keyCode || e.charCode, - form = e.findElement('FORM'); + form = e.findElement('FORM'), trigger = e.findElement(); + + if (trigger.id == 'kronolithEventLocation' && kc == Event.KEY_RETURN) { + this.ensureMap(); + this.geocode($F('kronolithEventLocation')); + e.stop(); + return; + } if (form) { switch (kc) { -- 2.11.0