@mikezimm/fps-library-v2
Version:
Library of reusable typescript/javascript functions, interfaces and constants
32 lines (31 loc) • 1.41 kB
JavaScript
/**
* CodeAnalizerComment: Updated 1 imports on 2024-09-22 14:49:52
* Update:: import { IAnySourceItem } to '@mikezimm/fps-core-v7/lib/components/molecules/AnyContent/IAnyContent;'
*/
export function onFPSClick(event, tile) {
const { altKey, ctrlKey, shiftKey, metaKey } = event;
const { FPSItem } = tile;
const { href, altUrl, ctrlUrl, shiftUrl, key3Url } = FPSItem ? FPSItem.Link : null;
console.log('event', event);
console.log('tile', tile);
if (metaKey) {
const metaClick = `${href}${href.indexOf('?') > -1 ? '&' : '?'}debug=true&noredir=true&debugManifestsFile=https://localhost:4321/temp/manifests.js`;
window.open(metaClick, '_none'); // For SPO Link, _blank opens in new tab
}
else if (altKey && shiftKey && ctrlKey) {
window.open(key3Url ? key3Url : href, '_blank');
}
else if (ctrlKey) {
window.open(ctrlUrl ? ctrlUrl : href, '_blank'); // For SPO Link, _blank opens in new tab BUT DOES NOT jump to it
}
else if (altKey) {
window.open(altUrl ? altUrl : href, '_none'); // For SPO Link, _none opens in new tab AND Jumps to it
}
else if (shiftKey) {
window.open(shiftUrl ? shiftUrl : href, '_none');
}
else if (href) {
window.open(href, '_self'); // For SPO Link, _self opens in the CURRENT tab
}
}
//# sourceMappingURL=onFPSClick.js.map