Commit 1eada3b3 authored by Adam Spiers's avatar Adam Spiers
Browse files

avoid deleting existing classes when muting time elements

and make muting work for negative values
parent b1b4ee27
......@@ -468,9 +468,19 @@
var minutes = Math.floor( ( time / ( 1000 * 60 ) ) % 60 );
var seconds = Math.floor( ( time / 1000 ) % 60 );
hrEl.innerHTML = zeroPadInteger( hours );
hrEl.className = hours > 0 ? '' : 'mute';
if (hours == 0) {
hrEl.classList.add( 'mute' );
}
else {
hrEl.classList.remove( 'mute' );
}
minEl.innerHTML = ':' + zeroPadInteger( minutes );
minEl.className = (hours > 0 || minutes > 0) ? '' : 'mute';
if (hours == 0 && minutes == 0) {
minEl.classList.add( 'mute' );
}
else {
minEl.classList.remove( 'mute' );
}
secEl.innerHTML = ':' + zeroPadInteger( seconds );
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment