Basic cours support #44

Merged
Anri merged 67 commits from cours into main 2024-04-01 18:11:49 +02:00
2 changed files with 14 additions and 3 deletions
Showing only changes of commit 1ed7731b21 - Show all commits

View file

@ -1,5 +1,9 @@
{{#metadata}} {{#info}} {{#portfolio}} {{#link}}
<li role="button" onmouseup="openLink('{{link}}');">
<li
role="button"
onmousedown="disableScroll()"
onmouseup="openLink('{{link}}');"
>
{{>portfolio/project.html}}
</li>
{{/link}} {{^link}}

View file

@ -42,6 +42,13 @@
})
);
/* Middle click */
const disableScroll = () => {
if (event.button === 1) {
event.preventDefault();
}
};
/* Open cards link */
const openLink = (url) => {
const backgroundtab = () =>
@ -62,12 +69,12 @@
window.open(url, "_blank", "noreferrer");
}
break;
case 1:
/* Middle click */
event.preventDefault();
backgroundtab();
break;
default:
break;
}