mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-12 10:53:51 +00:00
refactor: extract navigation elements
This commit is contained in:
committed by
Carlos Valente
parent
7fdda1c969
commit
269091986a
@@ -20,13 +20,13 @@ export function openLink(url: string) {
|
||||
* serverUrl and baseURI are used for testing
|
||||
*/
|
||||
export function handleLinks(
|
||||
event: MouseEvent,
|
||||
location: string,
|
||||
event?: MouseEvent,
|
||||
externalServerUrl: string = serverURL,
|
||||
externalBaseURI: string = baseURI,
|
||||
) {
|
||||
// we handle the link manually
|
||||
event.preventDefault();
|
||||
event?.preventDefault();
|
||||
|
||||
const destination = new URL(externalServerUrl);
|
||||
destination.pathname = externalBaseURI ? `${externalBaseURI}/${location}` : location;
|
||||
|
||||
Reference in New Issue
Block a user