Show countdown in red if negative (projector and control panel).

Show 00:00 instead of --:--
This commit is contained in:
Emanuel Schuetze 2016-01-21 21:43:02 +01:00
parent b291473c61
commit 646bf52ea7
3 changed files with 21 additions and 20 deletions

View File

@ -458,6 +458,10 @@ img {
padding-right: 10px;
}
.col2 .countdown_timer.negative {
color: #CC0000;
}
.col2 .notNull {
color: red;
font-weight: bold;

View File

@ -333,25 +333,22 @@ angular.module('OpenSlidesApp.core', [
function () {
return function (totalseconds) {
var time;
var total = Math.abs(totalseconds);
if (parseInt(totalseconds)) {
var hh = Math.floor(total / 3600);
var mm = Math.floor(total % 3600 / 60);
var ss = Math.floor(total % 60);
var zero = "0";
// Add leading "0" for double digit values
hh = (zero+hh).slice(-2);
mm = (zero+mm).slice(-2);
ss = (zero+ss).slice(-2);
if (hh == "00")
time = mm + ':' + ss;
else
time = hh + ":" + mm + ":" + ss;
if (totalseconds < 0)
time = "-"+time;
} else {
time = "--:--";
}
// floor returns the largest integer of the absolut value of totalseconds
var total = Math.floor(Math.abs(totalseconds));
var hh = Math.floor(total / 3600);
var mm = Math.floor(total % 3600 / 60);
var ss = Math.floor(total % 60);
var zero = "0";
// Add leading "0" for double digit values
hh = (zero+hh).slice(-2);
mm = (zero+mm).slice(-2);
ss = (zero+ss).slice(-2);
if (hh == "00")
time = mm + ':' + ss;
else
time = hh + ":" + mm + ":" + ss;
if (totalseconds < 0)
time = "-"+time;
return time;
};
}

View File

@ -1,6 +1,6 @@
<div ng-controller="SlideCountdownCtrl">
<div ng-if="visible">
<div class="countdown well" style="margin-top: calc({{index}}*100px);">
<div class="countdown well" style="margin-top: calc({{index}}*100px);" ng-class="{ 'negative': seconds < 0 }">
{{ seconds | osSecondsToTime}}
<div class="description">{{ description }}</div>
</div>