From ae5ab1931ef6f16e8ebfac72080fe0f74e6fe851 Mon Sep 17 00:00:00 2001 From: kudo-sync-bot Date: Mon, 23 Dec 2024 10:16:07 -0800 Subject: [PATCH] =?UTF-8?q?Renamed=20`event`=20args=20of=20`forEach`=20loo?= =?UTF-8?q?ps=20in=20`handlers.drag`=20type=20methods=20of=20`alert()`=20t?= =?UTF-8?q?o=20`eventType`=20for=20better=20clarity=20=E2=86=9E=20[auto-sy?= =?UTF-8?q?nc=20from=20https://github.com/KudoAI/chatgpt.js]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- starters/chrome/extension/lib/chatgpt.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/starters/chrome/extension/lib/chatgpt.js b/starters/chrome/extension/lib/chatgpt.js index 72c9e5d86..d5c28f595 100644 --- a/starters/chrome/extension/lib/chatgpt.js +++ b/starters/chrome/extension/lib/chatgpt.js @@ -99,7 +99,8 @@ const chatgpt = { chatgpt.draggableElem = event.currentTarget chatgpt.draggableElem.style.cursor = 'grabbing' event.preventDefault(); // prevent sub-elems like icons being draggable - ['mousemove', 'mouseup'].forEach(event => document.addEventListener(event, handlers.drag[event])) + ['mousemove', 'mouseup'].forEach(eventType => + document.addEventListener(eventType, handlers.drag[eventType])) const draggableElemRect = chatgpt.draggableElem.getBoundingClientRect() handlers.drag.offsetX = event.clientX - draggableElemRect.left +21 handlers.drag.offsetY = event.clientY - draggableElemRect.top +12 @@ -114,8 +115,8 @@ const chatgpt = { mouseup() { // remove listeners, reset chatgpt.draggableElem chatgpt.draggableElem.style.cursor = 'inherit'; - ['mousemove', 'mouseup'].forEach(event => - document.removeEventListener(event, handlers.drag[event])) + ['mousemove', 'mouseup'].forEach(eventType => + document.removeEventListener(eventType, handlers.drag[eventType])) chatgpt.draggableElem = null } }