summaryrefslogtreecommitdiff
path: root/modules/gallery/js
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2010-01-12 09:42:06 -0800
committerTim Almdal <tnalmdal@shaw.ca>2010-01-12 09:42:06 -0800
commite81acce985b35602bf66ddbf9fe7fa5a065116c9 (patch)
treec860f96f37ac62152b5743f76ace5efbd6f91d12 /modules/gallery/js
parent42d7c9590ee480e106ac343e6b3224d2b0fdaab0 (diff)
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.
Diffstat (limited to 'modules/gallery/js')
-rw-r--r--modules/gallery/js/l10n_client.js5
1 files changed, 5 insertions, 0 deletions
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());