Skip to content

Commit 3916077

Browse files
authored
fix context passing
1 parent f205ebc commit 3916077

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/addons/addons/toolbox-category-drag/userscript.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export default async function ({ addon }) {
141141
toolbox.position();
142142
}
143143

144-
function initDragDroper(clickEvent) {
144+
function initDragDroper(clickEvent, blocklyToolboxDiv) {
145145
const draggedCat = clickEvent.target.closest(`div[class="scratchCategoryMenuRow"]`);
146146
if (!draggedCat) return;
147147

@@ -239,7 +239,7 @@ export default async function ({ addon }) {
239239
/* Check for Long (500ms) Presses to not confuse with Selecting Categories */
240240
const blocklyToolboxDiv = document.querySelector(`div[class*="blocklyToolboxDiv"`);
241241
blocklyToolboxDiv.addEventListener("mousedown", (e) => {
242-
const longPressTimer = setTimeout(() => initDragDroper(e), 500);
242+
const longPressTimer = setTimeout(() => initDragDroper(e, blocklyToolboxDiv), 500);
243243
const cancel = () => clearTimeout(longPressTimer);
244244

245245
document.addEventListener("mouseup", cancel, { once: true });

0 commit comments

Comments
 (0)