@glitchr/stickyjs 1.0.35 → 1.0.36
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 +0 -0
- package/package.json +1 -1
- package/src/css/index.css +0 -0
- package/src/index.js +8 -0
- package/src/js/sticky.js +2 -8
package/README.md
CHANGED
|
File without changes
|
package/package.json
CHANGED
package/src/css/index.css
CHANGED
|
File without changes
|
package/src/index.js
CHANGED
|
@@ -1,2 +1,10 @@
|
|
|
1
|
+
import $ from 'jquery';
|
|
2
|
+
|
|
3
|
+
// Modern browser: use passive event listeners where appropriate for better performance
|
|
4
|
+
jQuery.event.special.touchstart = { setup: function( _, ns, handle ) { this.addEventListener("touchstart", handle, { passive: !ns.includes("noPreventDefault") }); } };
|
|
5
|
+
jQuery.event.special.touchmove = { setup: function( _, ns, handle ) { this.addEventListener("touchmove", handle, { passive: !ns.includes("noPreventDefault") }); } };
|
|
6
|
+
jQuery.event.special.wheel = { setup: function( _, ns, handle ) { this.addEventListener("wheel", handle, { passive: true }); } };
|
|
7
|
+
jQuery.event.special.mousewheel = { setup: function( _, ns, handle ) { this.addEventListener("mousewheel", handle, { passive: true }); } };
|
|
8
|
+
|
|
1
9
|
import './js/sticky.js';
|
|
2
10
|
import './css/index.css';
|
package/src/js/sticky.js
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
// Modern browser: use passive event listeners where appropriate for better performance
|
|
2
|
-
jQuery.event.special.touchstart = { setup: function( _, ns, handle ) { this.addEventListener("touchstart", handle, { passive: !ns.includes("noPreventDefault") }); } };
|
|
3
|
-
jQuery.event.special.touchmove = { setup: function( _, ns, handle ) { this.addEventListener("touchmove", handle, { passive: !ns.includes("noPreventDefault") }); } };
|
|
4
|
-
jQuery.event.special.wheel = { setup: function( _, ns, handle ) { this.addEventListener("wheel", handle, { passive: true }); } };
|
|
5
|
-
jQuery.event.special.mousewheel = { setup: function( _, ns, handle ) { this.addEventListener("mousewheel", handle, { passive: true }); } };
|
|
6
|
-
|
|
7
|
-
var replaceHashFlag = false;
|
|
8
|
-
// Sticky.js
|
|
9
1
|
(function(namespace) {
|
|
10
2
|
|
|
3
|
+
var replaceHashFlag = false;
|
|
4
|
+
|
|
11
5
|
namespace.replaceHash = function(newHash, triggerHashChange = true, skipIfEmptyIdentifier = true) {
|
|
12
6
|
|
|
13
7
|
replaceHashFlag = true;
|