From f9b0bd2e7b5298960ab007954932e93556474b8b Mon Sep 17 00:00:00 2001 From: Rohit Tanwar <31792358+kriadmin@users.noreply.github.com> Date: Wed, 7 Mar 2018 17:07:26 +0530 Subject: [PATCH] Update Tag.js --- src/js/components/Tag.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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))