rytm-webflow 2.2.1 → 2.2.2
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 +1 -0
- package/package.json +1 -1
- package/scripts/aswap/ASwap.js +1 -0
- package/scripts/aswap/ASwapDispatcher.js +1 -1
package/README.md
CHANGED
|
@@ -149,6 +149,7 @@ RytmWebflow.aswap.init({
|
|
|
149
149
|
| ```historyFallback``` | ```true``` | Fallback if browser dosn't support history push state |
|
|
150
150
|
| ```cacheOn``` | ```true``` | By default all requests are being cached. Set to ```false``` to turn cache off |
|
|
151
151
|
| ```noCacheClassName``` | ```'no-as-cache'``` | By default all requests are being cached. Links with this class name don't use ajax cache |
|
|
152
|
+
| ```resetScrollOn``` | ```true``` | By default on each view swap the window is scrolled back up. This should be disabled if using ```lenis``` |
|
|
152
153
|
| ```noScrollClassName``` | ```'no-as-scroll'``` | By default each page transformation is reseting the window scroll. Links with this class don't scroll window back up |
|
|
153
154
|
| ```noSwapClassName``` | ```'no-as'``` | Links with this class or ```target=_blank``` don't load using ASwap |
|
|
154
155
|
| ```oldschoolBrowserFallback``` | ```true``` | If set to ```true``` IE 11 or lower is not supported |
|
package/package.json
CHANGED
package/scripts/aswap/ASwap.js
CHANGED
|
@@ -19,6 +19,7 @@ class ASwap {
|
|
|
19
19
|
historyFallback: true, // fallback of browser dosn't support history push state
|
|
20
20
|
cacheOn: true, // use Aswap Cache?
|
|
21
21
|
noCacheClassName: 'no-as-cache', // links with this class don't use ajax cache
|
|
22
|
+
resetScrollOn: true, // reset scroll position on view swap
|
|
22
23
|
noScrollClassName: 'no-as-scroll', // links with this class don't scroll window back up
|
|
23
24
|
noSwapClassName: 'no-as', // links with this class or target=_blank don't use ajax swap
|
|
24
25
|
oldschoolBrowserFallback: true, // IE11 or lower is not supported
|
|
@@ -197,7 +197,7 @@ class ASwapDispatcher extends EventDispatcher {
|
|
|
197
197
|
this.swapBodyToHtmlClasses(result);
|
|
198
198
|
}, 10)
|
|
199
199
|
// scroll up
|
|
200
|
-
if (!this.currentTrigger || !this.currentTrigger.classList.contains(this.noScrollClassName)) {
|
|
200
|
+
if (this.resetScrollOn && (!this.currentTrigger || !this.currentTrigger.classList.contains(this.noScrollClassName))) {
|
|
201
201
|
this.resetScrollPosition();
|
|
202
202
|
}
|
|
203
203
|
// dispatch swap event
|