Update handleClick to use consts

This commit is contained in:
Isaac Connor
2022-06-17 15:14:41 -04:00
parent dbedfb3303
commit 71ad8a2c98

View File

@@ -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 ) {