Skip to content

Commit

Permalink
Merge pull request #73 from ernesck/patch-1
Browse files Browse the repository at this point in the history
Update Bubbles.js
  • Loading branch information
dmitrizzle authored Mar 11, 2020
2 parents d1bb425 + cf3ccae commit 5ccb4e9
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions component/Bubbles.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5ccb4e9

Please sign in to comment.