@lexriver/dome 1.5.1 → 1.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/out/DomeRouter.js CHANGED
@@ -8,9 +8,10 @@ export var DomeRouter;
8
8
  let onNotFoundAction = undefined;
9
9
  window.addEventListener('popstate', async (e) => {
10
10
  // on go back
11
- //console.log(filename, 'window.popstate event', e, 'historyUrl=', historyUrls)
11
+ console.log(filename, 'window.popstate event', e, 'historyUrls=', historyUrls);
12
12
  const url = window.location.pathname;
13
13
  await executeAsync(url, getScrollPositionForUrl(url));
14
+ addUrlToHistory(url);
14
15
  // await DomeManipulator.scrollToAsync({
15
16
  // pxFromTop: getScrollPositionForUrl(window.location.pathname)
16
17
  // })
@@ -64,6 +65,8 @@ export var DomeRouter;
64
65
  if (historyUrls.length > 1) {
65
66
  historyUrls[historyUrls.length - 2].scroll = DomeManipulator.getCurrentScrollPosition();
66
67
  }
68
+ console.log('adding url to history', url);
69
+ console.log('historyUrls=', historyUrls);
67
70
  }
68
71
  function getCurrentUrl() {
69
72
  return historyUrls.length > 0 ? historyUrls[historyUrls.length - 1] : window.location.pathname;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "type": "module",
3
3
  "sideEffects": false,
4
4
  "name": "@lexriver/dome",
5
- "version": "1.5.1",
5
+ "version": "1.5.4",
6
6
  "description": "",
7
7
  "main": "out/index.js",
8
8
  "types": "out/index.d.ts",
package/src/DomeRouter.ts CHANGED
@@ -27,9 +27,10 @@ export module DomeRouter {
27
27
 
28
28
  window.addEventListener('popstate', async (e) => {
29
29
  // on go back
30
- //console.log(filename, 'window.popstate event', e, 'historyUrl=', historyUrls)
30
+ console.log(filename, 'window.popstate event', e, 'historyUrls=', historyUrls)
31
31
  const url = window.location.pathname
32
32
  await executeAsync(url, getScrollPositionForUrl(url) )
33
+ addUrlToHistory(url)
33
34
  // await DomeManipulator.scrollToAsync({
34
35
  // pxFromTop: getScrollPositionForUrl(window.location.pathname)
35
36
  // })
@@ -87,6 +88,9 @@ export module DomeRouter {
87
88
  if(historyUrls.length>1){
88
89
  historyUrls[historyUrls.length-2].scroll = DomeManipulator.getCurrentScrollPosition()
89
90
  }
91
+
92
+ console.log('adding url to history', url)
93
+ console.log('historyUrls=', historyUrls)
90
94
  }
91
95
 
92
96