From: Roan Kattouw Date: Fri, 14 Aug 2009 21:57:46 +0000 (+0000) Subject: Fix arrow throttling feature in mwsuggest which was broken in two entirely different... X-Git-Tag: 1.31.0-rc.0~40299 X-Git-Url: http://git.cyclocoop.org/?a=commitdiff_plain;h=cf53321a791433d404a95c59114bc2ad70c06078;p=lhc%2Fweb%2Fwiklou.git Fix arrow throttling feature in mwsuggest which was broken in two entirely different but equally interesting ways. --- diff --git a/skins/common/mwsuggest.js b/skins/common/mwsuggest.js index 4adcb9d422..d02c4958f0 100644 --- a/skins/common/mwsuggest.js +++ b/skins/common/mwsuggest.js @@ -553,6 +553,7 @@ function os_eventKeyup(e){ if(r == null) return; // not our event + os_last_keypress = 0; // some browsers won't generate keypressed for arrow keys, catch it if(os_keypressed_count == 0){ os_processKey(r,os_cur_keypressed,targ); @@ -596,9 +597,9 @@ function os_eventKeypress(e){ var d = new Date() var now = d.getTime(); if(now - os_last_keypress < 120){ - os_last_keypress = now; return; } + os_last_keypress = now; } os_keypressed_count++; @@ -616,7 +617,6 @@ function os_eventKeydown(e){ os_mouse_moved = false; os_cur_keypressed = (e.keyCode == undefined) ? e.which : e.keyCode; - os_last_keypress = 0; os_keypressed_count = 0; }