Skip to content

Commit

Permalink
colorselect interactive preview update
Browse files Browse the repository at this point in the history
  • Loading branch information
Unreal-Dan committed Aug 16, 2024
1 parent aeab2a5 commit e6f6533
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions docs/assets/js/ColorSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,13 @@ function handleDelete(slot) {
startFlashingRed(slot);
}, 500); // Start flashing red after holding for 500ms

const slotElement = document.querySelector(`[data-slot="${slot}"]`);

const onMouseUp = () => {
document.querySelector(`[data-slot="${slot}"]`).addEventListener('mouseup', () => {
clearTimeout(holdTimer);
if (deleteMode) {
deleteColor(slot); // Delete the color if it's flashing red
stopFlashingRed(slot);
}
document.removeEventListener('mouseup', onMouseUp); // Ensure the event listener is removed
};

slotElement.addEventListener('mouseup', onMouseUp, { once: true }); // Attach the event listener to the slot
});
}

function showHueQuadrantDropdown(slot) {
Expand Down

0 comments on commit e6f6533

Please sign in to comment.