From 9c8dd2d64ee3ee62f729821b81e9d1ea712e9863 Mon Sep 17 00:00:00 2001 From: amritrai5757 Date: Sat, 31 Dec 2022 11:49:08 +0000 Subject: [PATCH] Revert "Fixed removal of all colors issue." This reverts commit bc26132ce98de7171c5b2646a5555d77fbe4bf6c. --- js/PaletteBlock.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/js/PaletteBlock.js b/js/PaletteBlock.js index 79d043c..3035e43 100644 --- a/js/PaletteBlock.js +++ b/js/PaletteBlock.js @@ -109,15 +109,10 @@ const PaletteBlock = (() => { endIndex = tmp; } - // Checks if user is trying to remove all the colours from the palette and gives an alert if so - if(coloursList.childElementCount > Math.abs(startIndex-endIndex)+1) { - for (let i=startIndex; i<=endIndex; i++) { - coloursList.removeChild(coloursList.children[startIndex]); - } - clearBorders(); - } else { - alert("You can't remove all the colours from the palette!"); + for (let i=startIndex; i<=endIndex; i++) { + coloursList.removeChild(coloursList.children[startIndex]); } + clearBorders(); } /** Starts selecting a ramp. Saves the data needed to draw the outline.