Only scroll-focus when hoverring over preview
This commit is contained in:
parent
3a35e7f03c
commit
4d9de7652b
2 changed files with 17 additions and 15 deletions
|
|
@ -98,17 +98,17 @@ function keyMoveCallback(response, status) {
|
||||||
// Click-to-move
|
// Click-to-move
|
||||||
function clickHotspotImage(event) {
|
function clickHotspotImage(event) {
|
||||||
if (document.getElementById("clickPositionCheck").checked == true) {
|
if (document.getElementById("clickPositionCheck").checked == true) {
|
||||||
xCoordinate = event.offsetX;
|
xCoordinate = event.offsetX;
|
||||||
yCoordinate = event.offsetY;
|
yCoordinate = event.offsetY;
|
||||||
console.log(xCoordinate, yCoordinate)
|
console.log(xCoordinate, yCoordinate)
|
||||||
xRelative = (0.5*event.target.offsetWidth - xCoordinate)/event.target.offsetWidth;
|
xRelative = (0.5*event.target.offsetWidth - xCoordinate)/event.target.offsetWidth;
|
||||||
yRelative = (0.5*event.target.offsetHeight - yCoordinate)/event.target.offsetHeight;
|
yRelative = (0.5*event.target.offsetHeight - yCoordinate)/event.target.offsetHeight;
|
||||||
console.log(xRelative, yRelative)
|
console.log(xRelative, yRelative)
|
||||||
xSteps = xRelative * fovX;
|
xSteps = xRelative * fovX;
|
||||||
ySteps = yRelative * fovY;
|
ySteps = yRelative * fovY;
|
||||||
console.log(xSteps, ySteps, 0)
|
console.log(xSteps, ySteps, 0)
|
||||||
// Make a position request
|
// Make a position request
|
||||||
moveStagePositions(xSteps, ySteps, 0)
|
moveStagePositions(xSteps, ySteps, 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -116,10 +116,11 @@ function clickHotspotImage(event) {
|
||||||
window.addEventListener('wheel', function(e) {
|
window.addEventListener('wheel', function(e) {
|
||||||
multiplier = 1/100;
|
multiplier = 1/100;
|
||||||
z_delta = e.deltaY * multiplier * focusVelocity;
|
z_delta = e.deltaY * multiplier * focusVelocity;
|
||||||
if (document.getElementById("scrollFocusCheck").checked == true) {
|
if ((document.getElementById("scrollFocusCheck").checked == true) && (e.target.parentNode.classList["value"] == "column middle")) {
|
||||||
console.log(z_delta);
|
console.log(z_delta);
|
||||||
// Make a position request
|
console.log(e.target.parentNode.classList["value"]);
|
||||||
safeRequest("POST", baseURI+"/position", { "absolute": false, "z": z_delta}, keyMoveCallback)
|
// Make a position request
|
||||||
|
safeRequest("POST", baseURI+"/position", { "absolute": false, "z": z_delta}, keyMoveCallback)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ img {
|
||||||
|
|
||||||
.left, .right {
|
.left, .right {
|
||||||
background-color: #f4f4f4;
|
background-color: #f4f4f4;
|
||||||
|
overflow-y: scroll;
|
||||||
}
|
}
|
||||||
|
|
||||||
.left{
|
.left{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue