Skip to content

Commit 3e812f8

Browse files
committed
Moved event.preventDefault() in modals.handlers.drag.mousedown() up for readability
1 parent 451edbc commit 3e812f8

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

amazongpt/greasemonkey/amazongpt.user.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// @description Adds the magic of AI to Amazon shopping
44
// @author KudoAI
55
// @namespace https://kudoai.com
6-
// @version 2025.2.13.6
6+
// @version 2025.2.13.7
77
// @license MIT
88
// @icon https://amazongpt.kudoai.com/assets/images/icons/amazongpt/black-gold-teal/icon48.png?v=0fddfc7
99
// @icon64 https://amazongpt.kudoai.com/assets/images/icons/amazongpt/black-gold-teal/icon64.png?v=0fddfc7
@@ -663,11 +663,11 @@
663663
if (event.button != 0) return // prevent non-left-click drag
664664
if (getComputedStyle(event.target).cursor == 'pointer') return // prevent drag on interactive elems
665665
modals.draggingModal = event.currentTarget
666+
event.preventDefault() // prevent sub-elems like icons being draggable
666667
Object.assign(modals.draggingModal.style, { // update styles
667668
cursor: 'grabbing', transition: '0.1s', willChange: 'transform', transform: 'scale(1.05)' });
668669
[...modals.draggingModal.children] // prevent hover FX if drag lags behind cursor
669-
.forEach(child => child.style.pointerEvents = 'none')
670-
event.preventDefault(); // prevent sub-elems like icons being draggable
670+
.forEach(child => child.style.pointerEvents = 'none');
671671
['mousemove', 'mouseup'].forEach(eventType => // add listeners
672672
document.addEventListener(eventType, modals.handlers.drag[eventType]))
673673
const draggingModalRect = modals.draggingModal.getBoundingClientRect()

bravegpt/greasemonkey/bravegpt.user.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
// @description:zu Yengeza izimpendulo ze-AI ku-Brave Search (inikwa amandla yi-GPT-4o!)
149149
// @author KudoAI
150150
// @namespace https://kudoai.com
151-
// @version 2025.2.13.6
151+
// @version 2025.2.13.7
152152
// @license MIT
153153
// @icon https://assets.bravegpt.com/images/icons/bravegpt/icon48.png?v=df624b0
154154
// @icon64 https://assets.bravegpt.com/images/icons/bravegpt/icon64.png?v=df624b0
@@ -873,11 +873,11 @@
873873
if (event.button != 0) return // prevent non-left-click drag
874874
if (getComputedStyle(event.target).cursor == 'pointer') return // prevent drag on interactive elems
875875
modals.draggingModal = event.currentTarget
876+
event.preventDefault() // prevent sub-elems like icons being draggable
876877
Object.assign(modals.draggingModal.style, { // update styles
877878
cursor: 'grabbing', transition: '0.1s', willChange: 'transform', transform: 'scale(1.05)' });
878879
[...modals.draggingModal.children] // prevent hover FX if drag lags behind cursor
879-
.forEach(child => child.style.pointerEvents = 'none')
880-
event.preventDefault(); // prevent sub-elems like icons being draggable
880+
.forEach(child => child.style.pointerEvents = 'none');
881881
['mousemove', 'mouseup'].forEach(eventType => // add listeners
882882
document.addEventListener(eventType, modals.handlers.drag[eventType]))
883883
const draggingModalRect = modals.draggingModal.getBoundingClientRect()

duckduckgpt/greasemonkey/duckduckgpt.user.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
// @description:zu Yengeza izimpendulo ze-AI ku-DuckDuckGo (inikwa amandla yi-GPT-4o!)
149149
// @author KudoAI
150150
// @namespace https://kudoai.com
151-
// @version 2025.2.13.6
151+
// @version 2025.2.13.7
152152
// @license MIT
153153
// @icon https://assets.ddgpt.com/images/icons/duckduckgpt/icon48.png?v=06af076
154154
// @icon64 https://assets.ddgpt.com/images/icons/duckduckgpt/icon64.png?v=06af076
@@ -881,11 +881,11 @@
881881
if (event.button != 0) return // prevent non-left-click drag
882882
if (getComputedStyle(event.target).cursor == 'pointer') return // prevent drag on interactive elems
883883
modals.draggingModal = event.currentTarget
884+
event.preventDefault() // prevent sub-elems like icons being draggable
884885
Object.assign(modals.draggingModal.style, { // update styles
885886
cursor: 'grabbing', transition: '0.1s', willChange: 'transform', transform: 'scale(1.05)' });
886887
[...modals.draggingModal.children] // prevent hover FX if drag lags behind cursor
887-
.forEach(child => child.style.pointerEvents = 'none')
888-
event.preventDefault(); // prevent sub-elems like icons being draggable
888+
.forEach(child => child.style.pointerEvents = 'none');
889889
['mousemove', 'mouseup'].forEach(eventType => // add listeners
890890
document.addEventListener(eventType, modals.handlers.drag[eventType]))
891891
const draggingModalRect = modals.draggingModal.getBoundingClientRect(),

googlegpt/greasemonkey/googlegpt.user.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@
149149
// @description:zu Yengeza izimpendulo ze-AI ku-Google Search (inikwa amandla yi-Google Gemma + GPT-4o!)
150150
// @author KudoAI
151151
// @namespace https://kudoai.com
152-
// @version 2025.2.13.6
152+
// @version 2025.2.13.7
153153
// @license MIT
154154
// @icon https://assets.googlegpt.io/images/icons/googlegpt/black/icon48.png?v=59409b2
155155
// @icon64 https://assets.googlegpt.io/images/icons/googlegpt/black/icon64.png?v=59409b2
@@ -1025,11 +1025,11 @@
10251025
if (event.button != 0) return // prevent non-left-click drag
10261026
if (getComputedStyle(event.target).cursor == 'pointer') return // prevent drag on interactive elems
10271027
modals.draggingModal = event.currentTarget
1028+
event.preventDefault() // prevent sub-elems like icons being draggable
10281029
Object.assign(modals.draggingModal.style, { // update styles
10291030
cursor: 'grabbing', transition: '0.1s', willChange: 'transform', transform: 'scale(1.05)' });
10301031
[...modals.draggingModal.children] // prevent hover FX if drag lags behind cursor
1031-
.forEach(child => child.style.pointerEvents = 'none')
1032-
event.preventDefault(); // prevent sub-elems like icons being draggable
1032+
.forEach(child => child.style.pointerEvents = 'none');
10331033
['mousemove', 'mouseup'].forEach(eventType => // add listeners
10341034
document.addEventListener(eventType, modals.handlers.drag[eventType]))
10351035
const draggingModalRect = modals.draggingModal.getBoundingClientRect()

0 commit comments

Comments
 (0)