@glitchr/stickyjs 1.0.10 → 1.0.12

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/js/sticky.js +6 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glitchr/stickyjs",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "description": "Sticky scroll library",
5
5
  "main": "src/index.js",
6
6
  "repository": {
package/src/js/sticky.js CHANGED
@@ -945,6 +945,7 @@ $.fn.serializeObject = function () {
945
945
  });
946
946
  }
947
947
 
948
+ var first = true;
948
949
  var hasReset = false;
949
950
  Sticky.onScrollDelta = function (e) {
950
951
 
@@ -1021,6 +1022,11 @@ $.fn.serializeObject = function () {
1021
1022
 
1022
1023
  if(Sticky.userScroll(el) || $(el).hasClass("sticky-magnet") || (hash == null && elAll.length == 0)) {
1023
1024
 
1025
+ if(first) {
1026
+ first = false;
1027
+ return;
1028
+ }
1029
+
1024
1030
  window.replaceHash(hash, false, false);
1025
1031
  dispatchEvent(new HashChangeEvent("hashchange"))
1026
1032
  }