[WIP] filter btns session storage
This commit is contained in:
parent
25a27b492c
commit
8a6c6fd56d
@ -21,7 +21,7 @@ function initToggle() {
|
||||
if(filter) {
|
||||
let filterMap = new Map(JSON.parse(filter));
|
||||
for (let entry of filterMap.entries()) {
|
||||
if(entry[0] === btn.dataset.action) {
|
||||
if(entry[0] === btn.dataset.action && entry[1] !== 'true') {
|
||||
filterMap.set(entry[0],'true');
|
||||
} else {
|
||||
filterMap.set(entry[0],'false');
|
||||
@ -30,12 +30,13 @@ function initToggle() {
|
||||
sessionStorage.setItem('tripsFilter', JSON.stringify( Array.from(filterMap.entries())));
|
||||
}
|
||||
resetFilteredElements();
|
||||
console.log(btn.ariaPressed);
|
||||
if(btn.ariaPressed === 'false'){
|
||||
Array.prototype.forEach.call(btns, (b: HTMLButtonElement) => {
|
||||
b.setAttribute('aria-pressed', 'false');
|
||||
});
|
||||
triggerFilterAction(btn.dataset.action);
|
||||
} else {
|
||||
btn.setAttribute('aria-pressed', 'false');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user