Skip to content

Commit 99c895e

Browse files
authored
fix("main.ts"): added a change event listener to the gradient border radius checkbox (#237)
added a change event listener to the gradient border radius checkbox which changes the value of the input display based on checked attribute value of the checkbox "fix #234"
1 parent c0cae4f commit 99c895e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/main.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,12 @@ const gradientBorderColor2 = <HTMLInputElement>(
101101
const gradientBorderDegree = <HTMLInputElement>(
102102
document.querySelector('#gradient-border-degree')
103103
);
104-
104+
const gradientBorderRadius = <HTMLInputElement>(
105+
document.querySelector('#gradient-border-radius')
106+
);
107+
const gradientBorderInput = <HTMLInputElement>(
108+
document.querySelector('#gradient-border-input')
109+
)
105110
//gradient background color elements
106111
const gradientBackgroundInputs = document.querySelectorAll(
107112
'.gradient-background-inputs'
@@ -383,3 +388,8 @@ const createGradientPreview = (
383388
const fill = range?.value;
384389
preview.style.background = `linear-gradient(${fill}deg, ${colorFrom}, ${colorTo})`;
385390
};
391+
392+
//Toggle gradient border radius input display
393+
gradientBorderRadius.addEventListener('change', function() {
394+
gradientBorderInput.style.display = this.checked ? "inline" : "none"
395+
})

0 commit comments

Comments
 (0)