diff --git a/web/skins/classic/views/js/cycle.js b/web/skins/classic/views/js/cycle.js index 371942eb7..767fad475 100644 --- a/web/skins/classic/views/js/cycle.js +++ b/web/skins/classic/views/js/cycle.js @@ -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); }