fix cyclePrev with only 1 monitor
This commit is contained in:
parent
3f73c3bc9d
commit
381bf0c219
|
@ -31,11 +31,13 @@ function cycleNext() {
|
|||
}
|
||||
|
||||
function cyclePrev() {
|
||||
if ( monIdx ) {
|
||||
monIdx -= 1;
|
||||
} else {
|
||||
monIdx --;
|
||||
if ( monIdx < 0 ) {
|
||||
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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue