diff options
author | Adam Spiers <github@adamspiers.org> | 2016-04-16 17:40:21 +0100 |
---|---|---|
committer | Adam Spiers <github@adamspiers.org> | 2017-04-20 15:18:15 +0100 |
commit | 1eada3b3600f6ae3ecda4edec877571b409c61c8 (patch) | |
tree | 27ff973629f2407da9eb5df1aa3daa6385fe17aa /plugin/notes/notes.html | |
parent | b1b4ee270b189c4c9ed699df70ea10badc43edc9 (diff) | |
download | perl-software-in-gnu-guix-1eada3b3600f6ae3ecda4edec877571b409c61c8.tar perl-software-in-gnu-guix-1eada3b3600f6ae3ecda4edec877571b409c61c8.tar.gz |
avoid deleting existing classes when muting time elements
and make muting work for negative values
Diffstat (limited to 'plugin/notes/notes.html')
-rw-r--r-- | plugin/notes/notes.html | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/plugin/notes/notes.html b/plugin/notes/notes.html index 2012361..15bca19 100644 --- a/plugin/notes/notes.html +++ b/plugin/notes/notes.html @@ -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 ); } |