Use a pill with explicit links for iCal and Google Calendar.
This commit is contained in:
parent
1ff57e8c7a
commit
443ae1e05d
9 changed files with 34 additions and 40 deletions
|
|
@ -1,15 +0,0 @@
|
|||
// Calendar shortcode: on Android, the calendar links add the date in Google Calendar instead of
|
||||
// downloading the .ics file, because the Google Calendar app there can't open .ics files.
|
||||
{
|
||||
const isAndroid =
|
||||
navigator.userAgentData?.platform === 'Android' || /\bAndroid\b/i.test(navigator.userAgent);
|
||||
|
||||
if (isAndroid) {
|
||||
for (const link of document.querySelectorAll('a.tour-calendar[data-google-href]')) {
|
||||
link.href = link.dataset.googleHref;
|
||||
link.removeAttribute('download');
|
||||
link.title = link.dataset.googleTitle;
|
||||
link.querySelector('.visually-hidden').textContent = link.dataset.googleLabel;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue