Last active
August 29, 2015 14:01
-
-
Save jamierumbelow/fca3fd9f19efded163ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(".filter-list").find("input:checkbox").on "click", -> | |
childrenSelected = [] | |
typeSelected = [] | |
$('.filter-children input:checked').each -> childrenSelected.push($(this).attr('rel')) | |
$('.filters input:checked').each -> typeSelected.push($(this).attr('rel')) | |
selectors = [] | |
if childrenSelected.length > 0 | |
for child in childrenSelected | |
if typeSelected.length > 0 | |
for type in typeSelected | |
selectors.push ".#{child}.#{type}" | |
else | |
selectors.push ".#{child}" | |
else | |
for type in typeSelected | |
selectors.push ".#{type}" | |
if selectors.length > 0 | |
$('.timeline_element').hide() | |
$(selectors.join(', ')).show() | |
else | |
$('.timeline_element').show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment