Skip to content

Commit ae5ab19

Browse files
committed
Renamed event args of forEach loops in handlers.drag type methods of alert() to eventType for better clarity ↞ [auto-sync from https://github.com/KudoAI/chatgpt.js]
1 parent 22ace92 commit ae5ab19

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

starters/chrome/extension/lib/chatgpt.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ const chatgpt = {
9999
chatgpt.draggableElem = event.currentTarget
100100
chatgpt.draggableElem.style.cursor = 'grabbing'
101101
event.preventDefault(); // prevent sub-elems like icons being draggable
102-
['mousemove', 'mouseup'].forEach(event => document.addEventListener(event, handlers.drag[event]))
102+
['mousemove', 'mouseup'].forEach(eventType =>
103+
document.addEventListener(eventType, handlers.drag[eventType]))
103104
const draggableElemRect = chatgpt.draggableElem.getBoundingClientRect()
104105
handlers.drag.offsetX = event.clientX - draggableElemRect.left +21
105106
handlers.drag.offsetY = event.clientY - draggableElemRect.top +12
@@ -114,8 +115,8 @@ const chatgpt = {
114115

115116
mouseup() { // remove listeners, reset chatgpt.draggableElem
116117
chatgpt.draggableElem.style.cursor = 'inherit';
117-
['mousemove', 'mouseup'].forEach(event =>
118-
document.removeEventListener(event, handlers.drag[event]))
118+
['mousemove', 'mouseup'].forEach(eventType =>
119+
document.removeEventListener(eventType, handlers.drag[eventType]))
119120
chatgpt.draggableElem = null
120121
}
121122
}

0 commit comments

Comments
 (0)