feat: open the next three months of Wednesday shifts on the public list
Volunteers can see who is signed up, and a full shift stays closed. Coordinators can see a contact's current and past shifts.
This commit is contained in:
1 parent
e7c99a788e
commit
1a8959c86a
26 files changed
+1402
-192
No files matched your search
@@ -1,6 +1,7 @@
|
||||
(function () {
|
||||
bindNav();
|
||||
bindCalendar();
|
||||
bindViewMenu();
|
||||
document.querySelectorAll('[data-contact]').forEach(bindContact);
|
||||
document.querySelectorAll('[data-see-more]').forEach(bindSeeMore);
|
||||
|
||||
@@ -23,6 +24,21 @@
|
||||
});
|
||||
}
|
||||
|
||||
function bindViewMenu() {
|
||||
var menus = document.querySelectorAll('details.view-menu');
|
||||
if (!menus.length) return;
|
||||
document.addEventListener('click', function (event) {
|
||||
for (var i = 0; i < menus.length; i += 1) {
|
||||
if (!menus[i].open || menus[i].contains(event.target)) continue;
|
||||
menus[i].open = false;
|
||||
}
|
||||
});
|
||||
document.addEventListener('keydown', function (event) {
|
||||
if (event.key !== 'Escape') return;
|
||||
for (var i = 0; i < menus.length; i += 1) menus[i].open = false;
|
||||
});
|
||||
}
|
||||
|
||||
function bindCalendar() {
|
||||
var calendar = document.querySelector('.shift-calendar');
|
||||
var weeks = document.querySelectorAll('.cal-week');
|
||||
|
||||
Reference in new issue
Block a user