Skip to content

Commit

Permalink
Fix bug where last item in select couldn't be removed.
Browse files Browse the repository at this point in the history
  • Loading branch information
LoonyPandora committed Nov 22, 2011
1 parent dd7d8c2 commit ce02f6e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions public/js/app.js
Expand Up @@ -5,10 +5,15 @@ $(document).ready(function() {
$('#nick-filter').change(function() {
// Hide them all
$('ol li').hide();
$.each($('#nick-filter').val(), function(key, value) {
// And turn the ones we want back on.
$('ol li.'+value).show();
});

// If its the last nick, don't try to iterate over them all
if ($('#nick-filter').val()) {
$.each($('#nick-filter').val(), function(key, value) {
// And turn the ones we want back on.
$('ol li.'+value).show();
});

}
});

// non functional atm, but stubbed anyway.
Expand Down

0 comments on commit ce02f6e

Please sign in to comment.