From b36493bebe1cbc334db3d5576123822259d39945 Mon Sep 17 00:00:00 2001 From: hoothin Date: Wed, 23 Oct 2024 17:05:40 +0800 Subject: [PATCH] Update searchJumper.user.js --- searchJumper.user.js | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/searchJumper.user.js b/searchJumper.user.js index 1c0d7051..613f7921 100644 --- a/searchJumper.user.js +++ b/searchJumper.user.js @@ -4066,14 +4066,18 @@ let curY = clientY(e) - startMouse.y; if (Math.abs(curX) + Math.abs(curY) < 5) return; if (tips.style.right === "") { - tips.style.left = (startPos.left + curX) + "px"; + tips.style.setProperty("left", (startPos.left + curX) + "px", "important"); + //tips.style.left = (startPos.left + curX) + "px!important"; } else { - tips.style.right = (startPos.right - curX) + "px"; + tips.style.setProperty("right", (startPos.right - curX) + "px", "important"); + //tips.style.right = (startPos.right - curX) + "px!important"; } if (tips.style.bottom === "") { - tips.style.top = (startPos.top + curY) + "px"; + tips.style.setProperty("top", (startPos.top + curY) + "px", "important"); + //tips.style.top = (startPos.top + curY) + "px!important"; } else { - tips.style.bottom = (startPos.bottom - curY) + "px"; + tips.style.setProperty("bottom", (startPos.bottom - curY) + "px", "important"); + //tips.style.bottom = (startPos.bottom - curY) + "px!important"; } tips.classList.add("draging"); }; @@ -4090,11 +4094,12 @@ e.preventDefault(); e.stopPropagation(); startMouse = {x: clientX(e), y: clientY(e)}; + let tipsStyle = getComputedStyle(tips); startPos = { - left: parseFloat(tips.style.left), - right: parseFloat(tips.style.right), - top: parseFloat(tips.style.top), - bottom: parseFloat(tips.style.bottom) + left: parseFloat(tipsStyle.left), + right: parseFloat(tipsStyle.right), + top: parseFloat(tipsStyle.top), + bottom: parseFloat(tipsStyle.bottom) }; cb && cb(); };