From e81acce985b35602bf66ddbf9fe7fa5a065116c9 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Tue, 12 Jan 2010 09:42:06 -0800 Subject: If the user hits enter in the search text field, then cancel the submission, because the search is done in the browser and the the enter will unexpectedly reload the root directory. --- modules/gallery/js/l10n_client.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules/gallery/js') diff --git a/modules/gallery/js/l10n_client.js b/modules/gallery/js/l10n_client.js index f0aff0b6..d0d6f619 100644 --- a/modules/gallery/js/l10n_client.js +++ b/modules/gallery/js/l10n_client.js @@ -234,6 +234,11 @@ Gallery.behaviors.l10nClient = function(context) { $.hotkeys.add(Gallery.l10nClient.keys['clear'], {target:'#l10n-client #g-l10n-search', type:'keyup'}, function(){Gallery.l10nClient.key('clear');}); } + // never actually submit the form as the search is done in the browser + $('#g-l10n-search-form').submit(function() { + return false; + }); + // Custom listener for l10n_client livesearch $('#l10n-client #g-l10n-search').keyup(function(key) { Gallery.l10nClient.filter($('#l10n-client #g-l10n-search').val()); -- cgit v1.2.3