Skip to content

Commit

Permalink
Ticket #51: Made sure wizzard hint cannot be dragged outside of the s…
Browse files Browse the repository at this point in the history
…creen.
  • Loading branch information
frodeheg committed May 9, 2023
1 parent cd380ab commit 764c1f0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions settings/subpages/wizzard.js
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,10 @@ function dragElement(elmnt) {
pos3 = e.clientX;
pos4 = e.clientY;
// set the element's new position:
elmnt.style.top = `${Math.min(Math.max(elmnt.offsetTop - pos2, -20), window.innerHeight - 10)}px`;
elmnt.style.top = `${Math.min(Math.max(elmnt.offsetTop - pos2, -20), window.innerHeight - 20)}px`;
elmnt.style.bottom = '';
elmnt.style.left = `${elmnt.offsetLeft - pos1}px`;
const wizWidth = parseInt(document.getElementById('wizHint').style.width);
elmnt.style.left = `${Math.min(Math.max(elmnt.offsetLeft - pos1, 20 - wizWidth), window.innerWidth - 20)}px`;
}

function closeDragElement(e) {
Expand Down

0 comments on commit 764c1f0

Please sign in to comment.