Skip to content

Commit e3b4261

Browse files
committed
Skip removeTransition if there is already no .playing class
1 parent bd06339 commit e3b4261

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

01 - JavaScript Drum Kit/index-START.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969

7070
function removeTransition(e) {
7171
if(e.propertyName !== 'transform') return; // skip it if it's not a transform
72+
if(!this.classList.contains('playing')) return; // skip if the transition if moving from ".playing" to not ".playing"
7273
this.classList.remove('playing');
7374
}
7475

0 commit comments

Comments
 (0)