@pushword/js-helper 0.0.102 → 0.0.103

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushword/js-helper",
3
- "version": "0.0.102",
3
+ "version": "0.0.103",
4
4
  "description": "Pushword front end helpers. ",
5
5
  "author": "Robin@PiedWeb <contact@piedweb.com>",
6
6
  "license": "MIT",
@@ -32,7 +32,10 @@ class ScrollYEnhancer {
32
32
  element.scrollTop += evt.deltaY
33
33
  const after = element.scrollTop
34
34
  if (before === after) {
35
- window.scrollBy(0, evt.deltaY / 2)
35
+ window.scrollWithoutDoingNothing++
36
+ if (window.scrollWithoutDoingNothing > 10) window.scrollBy(0, evt.deltaY / 2)
37
+ } else {
38
+ window.scrollWithoutDoingNothing = 0
36
39
  }
37
40
  //element.classList.toggle('scroll-smooth')
38
41
  })
@@ -137,7 +140,10 @@ class ScrollXEnhancer {
137
140
  element.scrollLeft += evt.deltaY
138
141
  const after = element.scrollLeft
139
142
  if (before === after) {
140
- window.scrollBy(0, evt.deltaY / 2)
143
+ window.scrollWithoutDoingNothing++
144
+ if (window.scrollWithoutDoingNothing > 10) window.scrollBy(0, evt.deltaY / 2)
145
+ } else {
146
+ window.scrollWithoutDoingNothing = 0
141
147
  }
142
148
  //element.classList.toggle('scroll-smooth')
143
149
  })