Skip to content

Commit 3c803b5

Browse files
Support visual change for swapping between include and exclude pattern
1 parent 1b36cd2 commit 3c803b5

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/templates/components/git_form.jinja

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
<script>
2+
function changePattern(element) {
3+
console.log("Pattern changed", element.value);
4+
let patternType = element.value;
5+
const files = document.getElementsByName("tree-line");
6+
7+
Array.from(files).forEach((element) => {
8+
if (element.textContent.includes("Directory structure:")) {
9+
return;
10+
}
11+
12+
element.classList.toggle('line-through');
13+
element.classList.toggle('text-gray-500');
14+
element.classList.toggle('hover:text-inherit');
15+
element.classList.toggle('hover:no-underline');
16+
element.classList.toggle('hover:line-through');
17+
element.classList.toggle('hover:text-gray-500');
18+
});
19+
}
20+
</script>
21+
122
<div class="relative">
223
<div class="w-full h-full absolute inset-0 bg-gray-900 rounded-xl translate-y-2 translate-x-2"></div>
324
<div class="rounded-xl relative z-20 pl-8 sm:pl-10 pr-8 sm:pr-16 py-8 border-[3px] border-gray-900 bg-[#fff4da]">
@@ -34,6 +55,7 @@
3455
<div class="flex relative z-20 border-[3px] border-gray-900 rounded bg-white">
3556
<div class="relative flex items-center">
3657
<select id="pattern_type"
58+
onchange = "changePattern(this)"
3759
name="pattern_type"
3860
class="w-21 py-2 pl-2 pr-6 appearance-none bg-[#e6e8eb] focus:outline-none border-r-[3px] border-gray-900">
3961
<option value="exclude"

0 commit comments

Comments
 (0)