mirror of
https://github.com/kiwix/kiwix-js-pwa.git
synced 2025-09-09 04:06:27 -04:00
Remove timeout for findInArticle event listener #65
Former-commit-id: a006135103d6d7154a604a9bb0b8a890cb01f5d9 [formerly fa190c94afe28011b0c57851684501285dfc0e4e] Former-commit-id: 74626580a2597bef7340bcedd43f11f03f2d5bd7
This commit is contained in:
parent
8b722362cc
commit
97b799108d
@ -316,8 +316,6 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies', 'q', 'module'
|
||||
localSearch.setMatchType('left');
|
||||
var timer = null;
|
||||
findInArticle.addEventListener('keyup', function (e) {
|
||||
//Ensure timeout doesn't occur if another key has been pressed within time window
|
||||
clearTimeout(timer);
|
||||
//If user pressed Alt-F or Ctrl-F, exit
|
||||
if ((e.altKey || e.ctrlKey) && e.which == 70) return;
|
||||
var val = this.value;
|
||||
@ -333,7 +331,6 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies', 'q', 'module'
|
||||
if (~(val.length - 2)) {
|
||||
localSearch.scrollFrom = 0;
|
||||
localSearch.lastScrollValue = val;
|
||||
timer = setTimeout(function () {
|
||||
localSearch.apply(val);
|
||||
if (val.length) {
|
||||
var fullTotal = localSearch.countFullMatches(val);
|
||||
@ -350,7 +347,6 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies', 'q', 'module'
|
||||
document.getElementById('matches').innerHTML = "Full: 0";
|
||||
document.getElementById('partial').innerHTML = "Partial: 0";
|
||||
}
|
||||
}, 500);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user