summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-opkg/htdocs/luci-static/resources
diff options
context:
space:
mode:
authorKid Dong <44045911+kidonng@users.noreply.github.com>2022-02-12 14:51:35 +0000
committerGitHub <noreply@github.com>2022-02-12 14:51:35 +0000
commit1e6f63033204de61d723b296bcd79a1140f9f659 (patch)
tree68f7397ee6e75287799b4f64d1b7bc61a115c14b /applications/luci-app-opkg/htdocs/luci-static/resources
parente3fbfe99094cc27ea7ad551fea193bc67c201ef0 (diff)
luci-app-opkg: listen to filter `input` event
Signed-off-by: Kid Dong <44045911+kidonng@users.noreply.github.com>
Diffstat (limited to 'applications/luci-app-opkg/htdocs/luci-static/resources')
-rw-r--r--applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js b/applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js
index 69b69be9b9..57f2006e53 100644
--- a/applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js
+++ b/applications/luci-app-opkg/htdocs/luci-static/resources/view/opkg.js
@@ -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') ])
])
]),