diff --git a/component/Bubbles.js b/component/Bubbles.js index 05d26e5..8a82e53 100644 --- a/component/Bubbles.js +++ b/component/Bubbles.js @@ -234,15 +234,17 @@ function Bubbles(container, self, options) { el.style.width = el.offsetWidth - sidePadding * 2 + widerBy + "px" })(bubbleButtons[z]) } - bubble.addEventListener("click", function() { - for (var i = 0; i < bubbleButtons.length; i++) { - ;(function(el) { - el.style.width = 0 + "px" - el.classList.contains("bubble-pick") ? (el.style.width = "") : false - el.removeAttribute("onclick") - })(bubbleButtons[i]) + bubble.addEventListener("click", function(e) { + if (e.target.classList.contains('bubble-button')) { + for (var i = 0; i < bubbleButtons.length; i++) { + ;(function(el) { + el.style.width = 0 + "px" + el.classList.contains("bubble-pick") ? (el.style.width = "") : false + el.removeAttribute("onclick") + })(bubbleButtons[i]) + } + this.classList.add("bubble-picked") } - this.classList.add("bubble-picked") }) } // time, size & animate