diff options
Diffstat (limited to 'src/renderer/customEvents.ts')
-rw-r--r-- | src/renderer/customEvents.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/renderer/customEvents.ts b/src/renderer/customEvents.ts new file mode 100644 index 0000000..dbdce31 --- /dev/null +++ b/src/renderer/customEvents.ts @@ -0,0 +1,7 @@ +export function switchPage(sitetype:"SERVER"|"INTERN",page:string,subPage?:string){ + const event = new CustomEvent('site-changed', { detail:{sitetype, page, subPage} }); + const elements = document.getElementsByClassName("switch-page-event"); + for (let i = 0; i < elements.length; i++) { + elements[i].dispatchEvent(event); + } +} |