diff --git a/src/index.html b/src/index.html index 4b85b02..8c154f3 100644 --- a/src/index.html +++ b/src/index.html @@ -104,7 +104,7 @@
-
Chargy WebApp
+
Chargy WebApp
@@ -220,7 +220,7 @@ Thuringian Ministry for Economic Affairs, Science and Digital Society-->
Thüringer Ministerium für Wirtschaft, Wissenschaft und Digitale Gesellschaft - ITnet Thüringen e.V. + ITnet Thüringen e.V.
diff --git a/src/ts/chargyApp.ts b/src/ts/chargyApp.ts index a3c637b..b41bf33 100644 --- a/src/ts/chargyApp.ts +++ b/src/ts/chargyApp.ts @@ -506,21 +506,22 @@ export class ChargyApp { //#region Modify external links to be opened in the external web browser - //const shell = require('electron').shell; const linkButtons = document.getElementsByClassName('linkButton') as HTMLCollectionOf; for (let i = 0; i < linkButtons.length; i++) { const linkButton = linkButtons[i]; - if (linkButton != null) + if (linkButton) { linkButton.onclick = function (this: GlobalEventHandlers, ev: MouseEvent) { + ev.preventDefault(); const link = linkButton.getAttribute("href"); - if (link && (link.startsWith("http://") || link.startsWith("https://"))) { - //shell.openExternal(link); - } + + if (link && (link.startsWith("http://") || link.startsWith("https://"))) + window.open(link, '_blank'); + } }