summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2017-11-02 11:36:56 +0100
committerLars-Dominik Braun <lars@6xq.net>2017-11-02 11:36:56 +0100
commit21efd806a720ed959177f27c3094e5eecc698aac (patch)
tree5e92654d5e8dbbc689a070d742bb6894265305b0 /data
parent373a1577306994e15c2f7d279d303ddd2c09bf12 (diff)
downloadcomatose-21efd806a720ed959177f27c3094e5eecc698aac.tar.gz
comatose-21efd806a720ed959177f27c3094e5eecc698aac.tar.bz2
comatose-21efd806a720ed959177f27c3094e5eecc698aac.zip
Add project description
List of features is part of that, feature filtering was moved into the navbar.
Diffstat (limited to 'data')
-rw-r--r--data/script.js25
1 files changed, 21 insertions, 4 deletions
diff --git a/data/script.js b/data/script.js
index a4d1508..43cb45e 100644
--- a/data/script.js
+++ b/data/script.js
@@ -17,7 +17,7 @@ $(document).ready (function () {
return e;
}
e = {
- 'name': n.children ('.name').first ().text (),
+ 'name': n.find ('.name').first ().text (),
'rank': parseFloat (n.data ('rank')),
}
var year = n.find ('dl dd.ref * .year').first ();
@@ -76,7 +76,7 @@ $(document).ready (function () {
}
function selectedfeatures () {
- var sel = $('.filter-feature');
+ var sel = $('#filter-feature option');
var features = [];
for (i = 0; i < sel.length; i++) {
if ($(sel[i]).is (':checked')) {
@@ -92,11 +92,28 @@ $(document).ready (function () {
$('#filter').keyup ($.debounce (100, function () {
filterproto ($(this).val (), selectedfeatures ());
}));
- $('.filter-feature').change (function () {
+ $('#filter-feature').change (function () {
filterproto ($('#filter').val (), selectedfeatures ());
});
$('#protosort').show ();
- $('.filter-feature').show ();
+ $('#filter-feature').show ();
sortproto ($('#sort').val ());
filterproto ($('#filter').val (), selectedfeatures ());
+
+ /* see https://stackoverflow.com/a/38691517 */
+ $('.keep-open').on({
+ "shown.bs.dropdown": function() { $(this).attr('closable', false); },
+ //"click": function() { }, // For some reason a click() is sent when Bootstrap tries and fails hide.bs.dropdown
+ "hide.bs.dropdown": function() { return $(this).attr('closable') == 'true'; }
+ });
+
+ $('.keep-open').children().first().on({
+ "click": function() {
+ $(this).parent().attr('closable', true );
+ }
+ })
+
+ /* hide button “learn more” */
+ $('#about').on ({'shown.bs.collapse': function () { $('#learnmore').hide (); },
+ 'hidden.bs.collapse': function () { $('#learnmore').show (); }});
});