minor code cleanup, adding monitor click event in a previous for loop instead of iterating again

pull/2926/head
Isaac Connor 2020-03-24 16:16:32 -04:00
parent 63aaf76f0d
commit 8e2c76df61
1 changed files with 1 additions and 9 deletions

View File

@ -967,6 +967,7 @@ function initPage() {
imagedone(this, this.monId, false);
};
loadImage2Monitor(monId, monitorImageURL[monId]);
monitorCanvasObj[monId].addEventListener('click', clickMonitor, false);
}
} // end foreach monitor
@ -982,15 +983,6 @@ function initPage() {
ctx = canvas.getContext('2d');
drawGraph();
}
for ( i=0, len=monitorPtr.length; i < len; i += 1 ) {
var monitor_id = monitorPtr[i];
monitor_canvas = $('Monitor'+monitor_id);
if ( ! monitor_canvas ) {
console.log("No canvas found for monitor " + monitor_id);
continue;
}
monitor_canvas.addEventListener('click', clickMonitor, false);
}
setSpeed(speedIndex);
//setFit(fitMode); // will redraw
//setLive(liveMode); // will redraw