Show countdown in red if negative (projector and control panel).
Show 00:00 instead of --:--
This commit is contained in:
parent
b291473c61
commit
646bf52ea7
@ -458,6 +458,10 @@ img {
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
.col2 .countdown_timer.negative {
|
||||
color: #CC0000;
|
||||
}
|
||||
|
||||
.col2 .notNull {
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
|
@ -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;
|
||||
};
|
||||
}
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user