mirror of https://github.com/openwrt/luci.git
luci-app-opkg: listen to filter `input` event
Signed-off-by: Kid Dong <44045911+kidonng@users.noreply.github.com>pull/5667/head
parent
e3fbfe9909
commit
1e6f630332
|
@ -994,13 +994,13 @@ function updateLists(data)
|
|||
});
|
||||
}
|
||||
|
||||
var keyTimeout = null;
|
||||
var inputTimeout = null;
|
||||
|
||||
function handleKeyUp(ev) {
|
||||
if (keyTimeout !== null)
|
||||
window.clearTimeout(keyTimeout);
|
||||
function handleInput(ev) {
|
||||
if (inputTimeout !== null)
|
||||
window.clearTimeout(inputTimeout);
|
||||
|
||||
keyTimeout = window.setTimeout(function() {
|
||||
inputTimeout = window.setTimeout(function() {
|
||||
display(ev.target.value);
|
||||
}, 250);
|
||||
}
|
||||
|
@ -1027,7 +1027,7 @@ return view.extend({
|
|||
E('div', {}, [
|
||||
E('label', {}, _('Filter') + ':'),
|
||||
E('span', { 'class': 'control-group' }, [
|
||||
E('input', { 'type': 'text', 'name': 'filter', 'placeholder': _('Type to filter…'), 'value': query, 'keyup': handleKeyUp }),
|
||||
E('input', { 'type': 'text', 'name': 'filter', 'placeholder': _('Type to filter…'), 'value': query, 'input': handleInput }),
|
||||
E('button', { 'class': 'btn cbi-button', 'click': handleReset }, [ _('Clear') ])
|
||||
])
|
||||
]),
|
||||
|
|
Loading…
Reference in New Issue