mirror of
https://github.com/boostorg/website-v2.git
synced 2026-01-19 04:42:17 +00:00
16 lines
412 B
JavaScript
16 lines
412 B
JavaScript
/**
|
|
* handles card click navigation with modifier key support
|
|
* @param {Event} event - the click event
|
|
* @param {string} url - the URL to navigate to
|
|
*/
|
|
function handleCardClick(event, url) {
|
|
if (event.target.tagName === 'A' || event.target.closest('a')) {
|
|
return;
|
|
}
|
|
if (event.ctrlKey || event.metaKey || event.shiftKey) {
|
|
window.open(url, '_blank');
|
|
return;
|
|
}
|
|
window.location = url;
|
|
}
|