Update Snippet.js

This commit is contained in:
Rohit Tanwar
2018-03-07 18:54:35 +05:30
committed by GitHub
parent 7ec6a73242
commit f24da491b1

View File

@ -4,9 +4,9 @@ const snippets = selectAll('.snippet')
EventHub.on('Tag.click', data => {
snippets.forEach(snippet => {
snippet.style.display = 'block'
if (data.type === 'all') return
if (data.type.includes('all')) return
const tags = selectAll('.tags__tag', snippet)
if (!tags.some(el => el.dataset.type === data.type)) {
if (!tags.some(el => data.type.includes(el.dataset.type))) {
snippet.style.display = 'none'
}
})