From cea21b266fa914202e1db54fd668a95645471141 Mon Sep 17 00:00:00 2001 From: Z Date: Sun, 13 Jun 2021 21:11:01 +0100 Subject: [PATCH] maybe saari work? --- package.json | 2 +- src/main.tsx | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 51a3a78..3e1f755 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "webpack": "^5.38.1", "webpack-cli": "^4.7.0", "webpack-dev-server": "^3.11.2", - "z-pagerouter": "^1.0.5" + "z-pagerouter": "^1.0.6" }, "dependencies": { "css-minimizer-webpack-plugin": "^3.0.0" diff --git a/src/main.tsx b/src/main.tsx index 0ee5f22..aa34724 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -52,15 +52,14 @@ async function onLoad(): Promise { pageTitleElement: document.querySelector("#pageTitle"), pageContentElement: document.querySelector("#pageContent"), resetElementContent: !true, + onPageChanged: async function (_) { + pageState.currentPage = await pageRouter.getCurrentPageID(); + document.documentElement.dir = pageState.pageDirection; + }, }); reloadNavBar(pageRouter); - pageRouter.addEventListener("pageChanged", async function (_) { - pageState.currentPage = await pageRouter.getCurrentPageID(); - document.documentElement.dir = pageState.pageDirection; - }); - if (process.env.NODE_ENV == "development") { await playground(pageRouter); }