From 4042fabd87baaed19c8b58a4b3002cc71eac1923 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Sat, 22 Feb 2014 17:06:53 +0100 Subject: [PATCH] jquery.suggestions: Do not duplicate keypress logic This is handled in keyup/keypress handlers, no need to repeat it twice. Change-Id: I3ddcd21136b44eedcec53b1ecc91bad38f697402 --- resources/jquery/jquery.suggestions.js | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/resources/jquery/jquery.suggestions.js b/resources/jquery/jquery.suggestions.js index 3774d0c763..c4e95a48af 100644 --- a/resources/jquery/jquery.suggestions.js +++ b/resources/jquery/jquery.suggestions.js @@ -591,24 +591,6 @@ $.fn.suggestions = function () { // Store key pressed to handle later context.data.keypressed = e.which; context.data.keypressedCount = 0; - - switch ( context.data.keypressed ) { - // This preventDefault logic is duplicated from - // $.suggestions.keypress(), which sucks - // Arrow down - case 40: - e.preventDefault(); - e.stopImmediatePropagation(); - break; - // Arrow up, Escape and Enter - case 38: - case 27: - case 13: - if ( context.data.$container.is( ':visible' ) ) { - e.preventDefault(); - e.stopImmediatePropagation(); - } - } } ) .keypress( function ( e ) { context.data.keypressedCount++; -- 2.20.1