Compare commits
4 Commits
d9bde9bee6
...
cfaa22c48a
Author | SHA1 | Date |
---|---|---|
Nicola | cfaa22c48a | |
amritrai5757 | 153f0366d4 | |
amritrai5757 | d928f897a4 | |
amritrai5757 | 901fdced90 |
|
@ -108,7 +108,15 @@ const PaletteBlock = (() => {
|
|||
startIndex = endIndex;
|
||||
endIndex = tmp;
|
||||
}
|
||||
|
||||
// If there is only 1 color in palette and user wants to remove it, do nothing
|
||||
if(coloursList.childElementCount == 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If user wants to remove all colors of palette, remove all colors except last one
|
||||
if(coloursList.childElementCount == endIndex-startIndex+1) {
|
||||
endIndex--;
|
||||
}
|
||||
for (let i=startIndex; i<=endIndex; i++) {
|
||||
coloursList.removeChild(coloursList.children[startIndex]);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue