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 804686e commit aeab2a5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions docs/assets/js/ColorSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,18 @@ function handleDelete(slot) {
startFlashingRed(slot);
}, 500); // Start flashing red after holding for 500ms

document.querySelector(`[data-slot="${slot}"]`).addEventListener('mouseup', () => {
const slotElement = document.querySelector(`[data-slot="${slot}"]`);

const onMouseUp = () => {
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 aeab2a5

Please sign in to comment.