@thinkpixellab-public/px-vue 3.0.45 → 3.0.46
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/components/PxSlides.vue +34 -6
- package/package.json +1 -1
package/components/PxSlides.vue
CHANGED
|
@@ -82,7 +82,26 @@ export default {
|
|
|
82
82
|
scrollPreview: 0,
|
|
83
83
|
};
|
|
84
84
|
},
|
|
85
|
-
computed: {
|
|
85
|
+
computed: {
|
|
86
|
+
lethargyOverrides() {
|
|
87
|
+
const stability = parseFloat(this.$route.query?.scrollStability);
|
|
88
|
+
const sensitivity = parseFloat(this.$route.query?.scrollSensitivity);
|
|
89
|
+
const tolerance = parseFloat(this.$route.query?.scrollTolerance);
|
|
90
|
+
|
|
91
|
+
if (stability || sensitivity || tolerance) {
|
|
92
|
+
console.log('[Custom scroll values enabled.]');
|
|
93
|
+
console.log(`stability: ${stability || 8}`);
|
|
94
|
+
console.log(`sensitivity: ${sensitivity || 100}`);
|
|
95
|
+
console.log(`tolerance: ${tolerance || 1.1}`);
|
|
96
|
+
return {
|
|
97
|
+
stability: stability || 8,
|
|
98
|
+
sensitivity: sensitivity || 100,
|
|
99
|
+
tolerance: tolerance || 1.1,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
return null;
|
|
103
|
+
},
|
|
104
|
+
},
|
|
86
105
|
watch: {
|
|
87
106
|
syncSelected(nv, ov) {
|
|
88
107
|
let newIndex = this.itemKeys.indexOf(nv);
|
|
@@ -122,6 +141,20 @@ export default {
|
|
|
122
141
|
});
|
|
123
142
|
|
|
124
143
|
if (this.scrollEnabled) {
|
|
144
|
+
let overrides = this.lethargyOverrides;
|
|
145
|
+
|
|
146
|
+
if (overrides) {
|
|
147
|
+
this.lethargy = new Lethargy(
|
|
148
|
+
overrides.stability,
|
|
149
|
+
overrides.sensitivity,
|
|
150
|
+
overrides.tolerance
|
|
151
|
+
);
|
|
152
|
+
} else {
|
|
153
|
+
this.lethargy = new Lethargy();
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
this.lethargyPrevCheck = false;
|
|
157
|
+
|
|
125
158
|
this.$el.addEventListener('wheel', this.onWheel);
|
|
126
159
|
}
|
|
127
160
|
},
|
|
@@ -180,11 +213,6 @@ export default {
|
|
|
180
213
|
},
|
|
181
214
|
|
|
182
215
|
onWheel(e) {
|
|
183
|
-
if (typeof this.lethargy == 'undefined') {
|
|
184
|
-
this.lethargy = new Lethargy();
|
|
185
|
-
this.lethargyPrevCheck = false;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
216
|
if (this.scrollPreviewEnabled) {
|
|
189
217
|
const delta = (e.deltaY + e.deltaX) / 2;
|
|
190
218
|
if (Math.abs(delta) > 5) {
|