From 71ad8a2c982e1ef848b40555e4bc002cd93d2051 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 17 Jun 2022 15:14:41 -0400 Subject: [PATCH] Update handleClick to use consts --- web/skins/classic/views/js/watch.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/web/skins/classic/views/js/watch.js b/web/skins/classic/views/js/watch.js index 69204c357..da2ea785e 100644 --- a/web/skins/classic/views/js/watch.js +++ b/web/skins/classic/views/js/watch.js @@ -556,16 +556,15 @@ function fetchImage(streamImage) { function handleClick(event) { // target should be the img tag - var target = $j(event.target); - console.log("click " + showMode); - var width = target.width(); - var height = target.height(); + const target = $j(event.target); + const width = target.width(); + const height = target.height(); - var scaleX = parseInt(monitorWidth / width); - var scaleY = parseInt(monitorHeight / height); - var pos = target.offset(); - var x = parseInt((event.pageX - pos.left) * scaleX); - var y = parseInt((event.pageY - pos.top) * scaleY); + const scaleX = parseInt(monitorWidth / width); + const scaleY = parseInt(monitorHeight / height); + const pos = target.offset(); + const x = parseInt((event.pageX - pos.left) * scaleX); + const y = parseInt((event.pageY - pos.top) * scaleY); if (showMode == 'events' || !imageControlMode) { if ( event.shift ) {