fix scroll and click on chromium based browser
All checks were successful
ci/woodpecker/push/publish Pipeline was successful
All checks were successful
ci/woodpecker/push/publish Pipeline was successful
This commit is contained in:
parent
058eb3c8c8
commit
9c8718afac
2 changed files with 14 additions and 3 deletions
|
@ -1,5 +1,9 @@
|
||||||
{{#metadata}} {{#info}} {{#portfolio}} {{#link}}
|
{{#metadata}} {{#info}} {{#portfolio}} {{#link}}
|
||||||
<li role="button" onmouseup="openLink('{{link}}');">
|
<li
|
||||||
|
role="button"
|
||||||
|
onmousedown="disableScroll()"
|
||||||
|
onmouseup="openLink('{{link}}');"
|
||||||
|
>
|
||||||
{{>portfolio/project.html}}
|
{{>portfolio/project.html}}
|
||||||
</li>
|
</li>
|
||||||
{{/link}} {{^link}}
|
{{/link}} {{^link}}
|
||||||
|
|
|
@ -42,6 +42,13 @@
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/* Middle click */
|
||||||
|
const disableScroll = () => {
|
||||||
|
if (event.button === 1) {
|
||||||
|
event.preventDefault();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/* Open cards link */
|
/* Open cards link */
|
||||||
const openLink = (url) => {
|
const openLink = (url) => {
|
||||||
const backgroundtab = () =>
|
const backgroundtab = () =>
|
||||||
|
@ -62,12 +69,12 @@
|
||||||
window.open(url, "_blank", "noreferrer");
|
window.open(url, "_blank", "noreferrer");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
/* Middle click */
|
/* Middle click */
|
||||||
event.preventDefault();
|
|
||||||
backgroundtab();
|
backgroundtab();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue