diff options
author | Kristian Lyngstol <kly@kly.no> | 2016-03-13 18:48:39 +0000 |
---|---|---|
committer | Kristian Lyngstol <kly@kly.no> | 2016-03-13 18:48:39 +0000 |
commit | fe776bbc6f2e62436acea72f2f3bf027a6138ed8 (patch) | |
tree | 263526056b4db496b5011e780e9d7869492af16e | |
parent | d79ea3095ac5da8344ab727bcb84a73043bbb533 (diff) |
NMS: Fix switch moving bug
If you just clicked a switch without moving it would use whatever
coordinates were laying around, typically moving the switch onto the
previously moved one.
-rw-r--r-- | web/nms.gathering.org/js/nms-map.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/web/nms.gathering.org/js/nms-map.js b/web/nms.gathering.org/js/nms-map.js index 13a8103..b4f10b5 100644 --- a/web/nms.gathering.org/js/nms-map.js +++ b/web/nms.gathering.org/js/nms-map.js @@ -383,14 +383,17 @@ nmsMap._moveStopListen = function() { nmsMap._moveDone = function(e) { nmsMap._moveStopListen(); + if(nmsMap._moveOldBox == false) { + return; + } nmsMap._moveSubmit(); nmsMap._clearOld(nmsMap._moveOldBox); } nmsMap._moveStart = function(sw, e) { - console.log("moving " + sw); nmsMap._moving = sw; + nmsMap._moveOldBox = false; nmsMap._moveXstart = (e.pageX - e.target.offsetLeft) / nmsMap.scale; nmsMap._moveYstart = (e.pageY - e.target.offsetTop) / nmsMap.scale; nmsMap._moveBox = nmsData.switches.switches[sw].placement; |