minor code cleanup, adding monitor click event in a previous for loop instead of iterating again
parent
63aaf76f0d
commit
8e2c76df61
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue