Skip to content

Commit

Permalink
Removed debug logs from modals.dragHandlers() to reduce verbosity ↞…
Browse files Browse the repository at this point in the history
  • Loading branch information
kudo-sync-bot committed Nov 26, 2024
1 parent 572e269 commit f8572fd
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions chatgpt/amazongpt/amazongpt.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// @description Adds the magic of AI to Amazon shopping
// @author KudoAI
// @namespace https://kudoai.com
// @version 2024.11.26.1
// @version 2024.11.26.2
// @license MIT
// @icon https://amazongpt.kudoai.com/assets/images/icons/amazongpt/black-gold-teal/icon48.png?v=0fddfc7
// @icon64 https://amazongpt.kudoai.com/assets/images/icons/amazongpt/black-gold-teal/icon64.png?v=0fddfc7
Expand Down Expand Up @@ -710,10 +710,8 @@
mousedown(event) { // find modal, attach listeners, init XY offsets
if (event.button != 0) return // prevent non-left-click drag
if (getComputedStyle(event.target).cursor == 'pointer') return // prevent drag on interactive elems
log.caller = 'modals.dragHandlers.mousedown()'
modals.dragHandlers.draggableElem = event.currentTarget
modals.dragHandlers.draggableElem.style.cursor = 'grabbing'
log.debug(`Mouse down on div#${modals.dragHandlers.draggableElem?.id}`)
event.preventDefault(); // prevent sub-elems like icons being draggable
['mousemove', 'mouseup'].forEach(event => document.addEventListener(event, modals.dragHandlers[event]))
const draggableElemRect = modals.dragHandlers.draggableElem.getBoundingClientRect()
Expand All @@ -730,9 +728,7 @@
},

mouseup() { // remove listeners, reset modals.dragHandlerss.draggableElem
log.caller = 'modals.dragHandlers.mouseup()'
modals.dragHandlers.draggableElem.style.cursor = 'inherit'
log.debug(`Mouse up on div#${modals.dragHandlers.draggableElem?.id}`);
['mousemove', 'mouseup'].forEach(event =>
document.removeEventListener(event, modals.dragHandlers[event]))
modals.dragHandlers.draggableElem = null
Expand Down

0 comments on commit f8572fd

Please sign in to comment.