summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/catalog-search.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/js/catalog-search.js b/js/catalog-search.js
index 07e21f87..b91fc1ea 100644
--- a/js/catalog-search.js
+++ b/js/catalog-search.js
@@ -21,9 +21,8 @@ var catalogSearch = function() {
$controls.append($searchLabel)
.append($searchBox);
- $searchBox.change(function() {
- var query = new RegExp(this.value, 'm'),
- $found = searchThreads($threads, query);
+ $searchBox.keyup(function() {
+ var $found = searchThreads($threads, this.value);
$threads.hide();
$found.show();
});
@@ -31,7 +30,8 @@ var catalogSearch = function() {
// Filter threads by their content, given a regex. Can be extended later to load data
// remotely and filter by multiple fields
-var searchThreads = function($threads, re) {
+var searchThreads = function($threads, query) {
+ var re = new RegExp(query, 'mi');
return $threads.filter(function() {
return re.test($('.replies', this).text());
});