From 8e2c76df61653b072ea2c6c8b820f8728b15a322 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 24 Mar 2020 16:16:32 -0400 Subject: [PATCH] minor code cleanup, adding monitor click event in a previous for loop instead of iterating again --- web/skins/classic/views/js/montagereview.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/web/skins/classic/views/js/montagereview.js b/web/skins/classic/views/js/montagereview.js index 46f9b1ab2..9c7592ae3 100644 --- a/web/skins/classic/views/js/montagereview.js +++ b/web/skins/classic/views/js/montagereview.js @@ -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