Skip to content

Commit c7d9165

Browse files
committed
Merged early return conditions in modals.handlers.drag.mousedown() ↞ [auto-sync from https://github.com/adamlui/ai-web-extensions/tree/main/bravegpt]
1 parent 33fb483 commit c7d9165

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

chatgpt/bravegpt/bravegpt.user.js

Lines changed: 3 additions & 4 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.10.12.2
151+
// @version 2025.10.12.3
152152
// @license MIT
153153
// @icon https://assets.bravegpt.com/images/icons/app/icon48.png?v=e8ca7c2
154154
// @icon64 https://assets.bravegpt.com/images/icons/app/icon64.png?v=e8ca7c2
@@ -2020,10 +2020,9 @@
20202020
mousedown(event) { // find modal, update styles, attach listeners, init XY offsets
20212021
if ( // prevent drag when...
20222022
event.button != 0 // non-left-click
2023-
|| event.target.closest('ul') // entry elem
2023+
|| !/auto|default/.test(getComputedStyle(event.target).cursor) // cursor changed
2024+
|| event.target.closest('ul') // entry elem
20242025
) return
2025-
if (!/auto|default/.test(getComputedStyle(event.target).cursor))
2026-
return // prevent drag on interactive elems
20272026
modals.draggingModal = event.currentTarget
20282027
event.preventDefault() // prevent sub-elems like icons being draggable
20292028
Object.assign(modals.draggingModal.style, { // update styles

0 commit comments

Comments
 (0)