summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-10-21 13:16:34 +0200
committerTor Andersson <tor@ccxvii.net>2023-10-21 19:41:47 +0200
commit3e64f888c60975f40cb7b2e2cd60e29da2d3fb19 (patch)
tree3b2ca359772ee44bad02b58c1cbc5a8d49febf9f /public
parent7d2ca3c07f347a819cd7e56134c9201aac9ff238 (diff)
downloadserver-3e64f888c60975f40cb7b2e2cd60e29da2d3fb19.tar.gz
Move "scroll with middle mouse" initialization to common code.
Diffstat (limited to 'public')
-rw-r--r--public/common/client.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/public/common/client.js b/public/common/client.js
index 8168250..6dd38f2 100644
--- a/public/common/client.js
+++ b/public/common/client.js
@@ -901,9 +901,12 @@ var update_layout = function () {}
/* PAN & ZOOM GAME BOARD */
;(function panzoom_init() {
+ var PAN_SPEED = Number(document.querySelector("main").dataset.panSpeed) || 1
var MIN_ZOOM = Number(document.querySelector("main").dataset.minZoom) || 0.5
var MAX_ZOOM = Number(document.querySelector("main").dataset.maxZoom) || 1.5
+ scroll_with_middle_mouse("main", PAN_SPEED)
+
const THRESHOLD = 0.0625
const DECELERATION = 125