fix cyclePrev with only 1 monitor
This commit is contained in:
parent
3f73c3bc9d
commit
381bf0c219
|
@ -31,11 +31,13 @@ function cycleNext() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function cyclePrev() {
|
function cyclePrev() {
|
||||||
if ( monIdx ) {
|
monIdx --;
|
||||||
monIdx -= 1;
|
if ( monIdx < 0 ) {
|
||||||
} else {
|
|
||||||
monIdx = monitorData.length - 1;
|
monIdx = monitorData.length - 1;
|
||||||
}
|
}
|
||||||
|
if ( !monitorData[monIdx] ) {
|
||||||
|
console.log('No monitorData for ' + monIdx);
|
||||||
|
}
|
||||||
|
|
||||||
window.location.replace('?view=cycle&mid='+monitorData[monIdx].id+'&mode='+mode, cycleRefreshTimeout);
|
window.location.replace('?view=cycle&mid='+monitorData[monIdx].id+'&mode='+mode, cycleRefreshTimeout);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue