diff --git a/src/js/components/Tag.js b/src/js/components/Tag.js index 734b2b320..e7632f600 100644 --- a/src/js/components/Tag.js +++ b/src/js/components/Tag.js @@ -1,14 +1,27 @@ import { select, selectAll, on } from '../deps/utils' const tagButtons = selectAll('button.tags__tag') - +let isShiftSelected = false; const onClick = function() { + if(isShiftSelected){ + document.querySelector.classList.remove('is-active') + } + else{ tagButtons.forEach(button => button.classList.remove('is-active')) + } this.classList.add('is-active') EventHub.emit('Tag.click', { type: this.dataset.type }) } +onkeydown = e => ( + if(e.shiftKey){ + isShiftSelected = true; +}); +onkeyup = e => ( + if(e.shiftKey){ + isShiftSelected = false; +}); tagButtons.forEach(button => on(button, 'click', onClick))