summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/script.js16
1 files changed, 10 insertions, 6 deletions
diff --git a/data/script.js b/data/script.js
index f1e9a68..d680225 100644
--- a/data/script.js
+++ b/data/script.js
@@ -13,11 +13,8 @@ $(document).ready (function () {
});
protolist.append (items);
}
- $('#sort').change (function () {
- sortproto ($(this).val ());
- });
- $('#filter').keyup (function () {
- var search = $(this).val ().toLowerCase ();
+ function filterproto (search) {
+ search = search.toLowerCase ()
var items = $('#protocols .protocol');
for (var i = 0; i < items.length; i++) {
var e = $(items[i]);
@@ -27,7 +24,14 @@ $(document).ready (function () {
e.hide ();
}
}
+ }
+ $('#sort').change (function () {
+ sortproto ($(this).val ());
+ });
+ $('#filter').keyup (function () {
+ filterproto ($(this).val ());
});
$('#protosort').show ();
- sortproto ('name');
+ sortproto ($('#sort').val ());
+ filterproto ($('#filter').val ());
});