Skip to content

Commit

Permalink
preview: use cursors grab and grabbing
Browse files Browse the repository at this point in the history
  • Loading branch information
qjebbs committed Mar 30, 2024
1 parent 30a4ed6 commit e6c933f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions templates/js/cursor.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function addCursorManager(settings) {
// console.log("leftButton", leftButton, "rightButton", rightButton);
if (!leftButton && !rightButton) {
if (settings.swapMouseButtons) {
imgContainer.style.cursor = "move";
imgContainer.style.cursor = "grab";
} else if (e.altKey) {
imgContainer.style.cursor = "zoom-out";
} else {
Expand All @@ -27,7 +27,14 @@ function addCursorManager(settings) {
return;
}
// move
imgContainer.style.cursor = "move";
if (
(leftButton && settings.swapMouseButtons) ||
(rightButton && !settings.swapMouseButtons)
) {
imgContainer.style.cursor = "grabbing";
} else {
imgContainer.style.cursor = "grab";
}
}
imgContainer.addEventListener("mousedown", e => {
// console.log("mousedown", e.button, e.buttons);
Expand Down

0 comments on commit e6c933f

Please sign in to comment.