saasufy-components 7.2.0 → 7.3.0

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/README.md CHANGED
@@ -232,6 +232,7 @@ If you want to make sure that some data (e.g. a config file) has been fully load
232
232
  - `no-auth-redirect`: An optional alternative path/route to redirect to if the user is on this page but they are not authenticated. If the user is authenticated, then the content of the template will be displayed as normal.
233
233
  - `auth-redirect`: An optional alternative path/route to redirect to if the user is on this page but they are already authenticated. If the user is not authenticated, then the content of the template will be displayed as normal.
234
234
  - `hard-redirect`: An optional, additional attribute which can be specified alongside a `redirect`, `no-auth-redirect` or `auth-redirect` attribute to ensure that any redirect will change the URL in the address bar. Redirects are `soft` redirects by default; this means that they redirect the user to the target page but keep the current URL path unchanged.
235
+ - `auto-reset-window-scroll`: If this attribute is present, the page scroll will be reset to the top when each new page is rendered.
235
236
 
236
237
  ### socket-provider
237
238
 
package/app-router.js CHANGED
@@ -255,6 +255,10 @@ export class AppRouter extends SocketConsumer {
255
255
 
256
256
  this.lastPageState = pageState;
257
257
 
258
+ if (this.hasAttribute('auto-reset-window-scroll')) {
259
+ window.scrollTo(0, 0);
260
+ }
261
+
258
262
  routerViewport.innerHTML = renderTemplate(
259
263
  pageTemplate.innerHTML,
260
264
  routeArgs,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saasufy-components",
3
- "version": "7.2.0",
3
+ "version": "7.3.0",
4
4
  "description": "Components for Saasufy.",
5
5
  "main": "index.js",
6
6
  "scripts": {