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 994f44a commit 0f56544
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions greasemonkey/duckduckgpt.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
// @description:zu Yengeza izimpendulo ze-AI ku-DuckDuckGo (inikwa amandla yi-GPT-4o!)
// @author KudoAI
// @namespace https://kudoai.com
// @version 2024.11.26.1
// @version 2024.11.26.2
// @license MIT
// @icon https://media.ddgpt.com/images/icons/duckduckgpt/icon48.png?af89302
// @icon64 https://media.ddgpt.com/images/icons/duckduckgpt/icon64.png?af89302
Expand Down Expand Up @@ -893,10 +893,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 @@ -916,9 +914,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 0f56544

Please sign in to comment.