diff --git a/VERSIONS_HOTLINE/148279 b/VERSIONS_HOTLINE/148279 new file mode 100644 index 0000000000000000000000000000000000000000..cb46a096b405582d5fe010d5ee5882ef34f104ef --- /dev/null +++ b/VERSIONS_HOTLINE/148279 @@ -0,0 +1 @@ + - correctif #148279 : Administration : La touche entrée ne recharge plus la page dans les champs de recherche des menus de l'administration. \ No newline at end of file diff --git a/public/opac/java/search_input/search_input.js b/public/opac/java/search_input/search_input.js index bbecaf8d96ae555ce843443d46efebfb445dabf2..4e663756018b30912cf99403f2bc10dbecf1ca3f 100644 --- a/public/opac/java/search_input/search_input.js +++ b/public/opac/java/search_input/search_input.js @@ -174,6 +174,10 @@ : $(options.input); search_input + .on('keypress', function(event) { + if (event.which == '13') + event.preventDefault(); + }) .on('keyup', function(event){ onSearchInputChange(this.value); }) diff --git a/public/opac/java/search_input/tests/search_input_test.js b/public/opac/java/search_input/tests/search_input_test.js index 36fe67694c3d68a1a6cec3d67a89356c077ff373..e131c1c5cd6ebb3784343320285e08d27b3ade68 100644 --- a/public/opac/java/search_input/tests/search_input_test.js +++ b/public/opac/java/search_input/tests/search_input_test.js @@ -166,3 +166,8 @@ test('search terms "cate" should not hide his childs', function() { fixture_ul_li.html()); }); + +test('keypress on search input should be bind', function() { + $events = $._data(fixture_ul_li.find('input')[0], 'events'); + equal($events['keypress'] !== undefined , true); +});