Skip to content

Commit 33fb483

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

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

chatgpt/amazongpt/amazongpt.user.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// @description Add AI chat & product/category summaries to Amazon shopping, powered by the latest LLMs like GPT-4o!
44
// @author KudoAI
55
// @namespace https://kudoai.com
6-
// @version 2025.10.12
6+
// @version 2025.10.12.1
77
// @license MIT
88
// @icon https://amazongpt.kudoai.com/assets/images/icons/app/black-gold-teal/icon48.png?v=8e8ed1c
99
// @icon64 https://amazongpt.kudoai.com/assets/images/icons/app/black-gold-teal/icon64.png?v=8e8ed1c
@@ -1354,10 +1354,9 @@
13541354
mousedown(event) { // find modal, update styles, attach listeners, init XY offsets
13551355
if ( // prevent drag when...
13561356
event.button != 0 // non-left-click
1357-
|| event.target.closest('ul') // entry elem
1357+
|| !/auto|default/.test(getComputedStyle(event.target).cursor) // cursor changed
1358+
|| event.target.closest('ul') // entry elem
13581359
) return
1359-
if (!/auto|default/.test(getComputedStyle(event.target).cursor))
1360-
return // prevent drag on interactive elems
13611360
modals.draggingModal = event.currentTarget
13621361
event.preventDefault() // prevent sub-elems like icons being draggable
13631362
Object.assign(modals.draggingModal.style, { // update styles
@@ -1842,7 +1841,7 @@
18421841
.chatgpt-modal button:hover {
18431842
${ env.ui.app.scheme == 'light' ? // reduce intensity of light scheme hover glow
18441843
'--btn-shadow: 2px 1px 43px #00cfff70 ;' : '' }
1845-
color: inherit !important ; background-color: inherit !important /* remove color hacks */
1844+
color: inherit ; background-color: inherit /* remove color hacks */
18461845
}
18471846
${ env.ui.app.scheme == 'dark' ? // darkmode chatgpt.alert() styles
18481847
`.chatgpt-modal > div, .chatgpt-modal button:not(.primary-modal-btn) {

0 commit comments

Comments
 (0)