Skip to content

Commit fc370c4

Browse files
committed
added radio deselection and improved date picker
Signed-off-by: Vedansh Saini <[email protected]>
1 parent d720b47 commit fc370c4

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed

src/popup.html

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,28 +29,17 @@ <h3 class="text-3xl font-semibold ">Scrum Helper</h3>
2929
<p class="font-semibold">SCRUM helper prefills the Scrums in google groups, with your FOSSASIA's contributions.</p>
3030
</div>
3131

32-
<!-- Change from here -->
3332
<div class="center mt-2 ">
3433
<label class="flex items-center justify-center gap-2">
3534
Disable
36-
<!-- <input type="checkbox" id="enable"> -->
3735
<input type="checkbox" value="" id="enable" class="sr-only peer" checked>
3836
<div class="relative w-11 h-6 bg-gray-200 rounded-full peer peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 dark:bg-gray-700 peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600 dark:peer-checked:bg-blue-600"></div>
3937
<span class=""></span>
4038
Enable
4139
</label>
4240
</div>
43-
<!-- <div class="row">
44-
<div class="col s12">
45-
<ul class="tabs">
46-
<li class="tab col s6" title="I am doing CodeHeat!"><a id="codeheatTab" href="#codeheatBox">CodeHeat</a></li>
47-
<li class="tab col s6" title="I am doing GSoC!"><a id="gsocTab" href="#gsocBox">GSoC</a></li>
48-
</ul>
49-
</div>
50-
</div> -->
5141
</div>
5242

53-
<!-- Till here -->
5443
<div class="rounded-2xl">
5544
<div class=" border-gray-100 border-2 bg-white rounded-3xl pl-4 py-2 mx-2 my-2">
5645
<div>
@@ -75,7 +64,7 @@ <h4>Your Github Username</h4>
7564
</div>
7665
</div>
7766

78-
<div class="flex justify-between items-center mt-2">
67+
<div id="customDateContainer" class="flex justify-between items-center mt-2">
7968
<div>
8069
<label for="startingDate">Start Date:</label>
8170
<input type="date" id="startingDate" class="border-2 border-gray-200 bg-gray-200 rounded-xl p-1">

src/scripts/popup.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,20 @@ function toggleRadio(radio){
6464
endDateInput.value = getToday();
6565
}
6666
startDateInput.disabled = endDateInput.disabled = true;
67-
}
67+
}
68+
document.getElementById('customDateContainer').addEventListener('click', () => {
69+
document.querySelectorAll('input[name="timeframe"]').forEach(radio => radio.checked = false);
70+
document.getElementById('startingDate').disabled = false;
71+
document.getElementById('endingDate').disabled = false;
72+
});
73+
// Not working properly
74+
// document.getElementById('startingDate').addEventListener('focus', () => {
75+
// document.querySelectorAll('input[name="timeframe"]').forEach(radio => radio.checked = false);
76+
// document.getElementById('startingDate').disabled = false;
77+
// document.getElementById('endingDate').disabled = false;
78+
// });
79+
// document.getElementById('endingDate').addEventListener('focus', () => {
80+
// document.querySelectorAll('input[name="timeframe"]').forEach(radio => radio.checked = false);
81+
// document.getElementById('startingDate').disabled = false;
82+
// document.getElementById('endingDate').disabled = false;
83+
// });

0 commit comments

Comments
 (0)