Skip to content

Commit

Permalink
fix(speiseplan): fix title of "contains alcohole" icon being irritati…
Browse files Browse the repository at this point in the history
…ng and wrong (#480)
  • Loading branch information
jxn-30 committed Nov 27, 2024
1 parent c822910 commit 9c09cf6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions redesign.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -2516,6 +2516,14 @@ const getSpeiseplan = async () => {
abk: filter.querySelector('span.abk')?.textContent?.trim() ?? '',
...(imgUrl ? { img: imgUrl.href } : {}),
};
// this is an inverted filter, so we need to find the matching text. Currently, Alcohol is the only case for this and at least there using the title of another alcohol bottle works
if (filter.dataset.ex === '1' && imgUrl) {
const alternativeTitle = mensaplanDoc.querySelector(
`:not(.filterbutton) > img[src="${imgUrl.pathname}"]`
)?.title;
if (alternativeTitle)
filters[type][filter.dataset.wert].title = alternativeTitle;
}
});
Object.freeze(filters);

Expand Down

0 comments on commit 9c09cf6

Please sign in to comment.