@mixd-id/web-scaffold 0.1.230406189 → 0.1.230406192
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 +1 -1
- package/src/components/Carousel.vue +34 -11
package/package.json
CHANGED
|
@@ -97,7 +97,8 @@ export default{
|
|
|
97
97
|
data(){
|
|
98
98
|
return {
|
|
99
99
|
index: 0,
|
|
100
|
-
timeoutId: null
|
|
100
|
+
timeoutId: null,
|
|
101
|
+
scrollPosition: null,
|
|
101
102
|
}
|
|
102
103
|
},
|
|
103
104
|
|
|
@@ -206,7 +207,7 @@ export default{
|
|
|
206
207
|
}
|
|
207
208
|
else if(Math.abs(dx) > 15){
|
|
208
209
|
this._props['direction'] = 'horizontal'
|
|
209
|
-
|
|
210
|
+
this.disableBodyScroll()
|
|
210
211
|
}
|
|
211
212
|
}
|
|
212
213
|
else if(this._props['direction'] === 'horizontal'){
|
|
@@ -232,6 +233,8 @@ export default{
|
|
|
232
233
|
else{
|
|
233
234
|
this.setPosition()
|
|
234
235
|
}
|
|
236
|
+
|
|
237
|
+
this.enableBodyScroll()
|
|
235
238
|
}
|
|
236
239
|
|
|
237
240
|
window.removeEventListener('mousemove', this.mouseMove)
|
|
@@ -240,12 +243,24 @@ export default{
|
|
|
240
243
|
window.removeEventListener('touchmove', this.mouseMove)
|
|
241
244
|
window.removeEventListener('touchend', this.mouseUp)
|
|
242
245
|
|
|
243
|
-
document.body.classList.remove(this.$style.noScroll)
|
|
244
|
-
|
|
245
246
|
if(this.autoPlay > 0)
|
|
246
247
|
this.play()
|
|
247
248
|
},
|
|
248
249
|
|
|
250
|
+
disableBodyScroll(){
|
|
251
|
+
this.scrollPosition = window.pageYOffset || document.documentElement.offsetTop
|
|
252
|
+
document.body.classList.add(this.$style.htmlNoScroll)
|
|
253
|
+
document.body.classList.add(this.$style.bodyNoScroll)
|
|
254
|
+
document.body.style.top = `-${this.scrollPosition}px`;
|
|
255
|
+
},
|
|
256
|
+
|
|
257
|
+
enableBodyScroll(){
|
|
258
|
+
document.body.style.removeProperty('top');
|
|
259
|
+
document.body.classList.remove(this.$style.bodyNoScroll)
|
|
260
|
+
document.body.classList.remove(this.$style.htmlNoScroll)
|
|
261
|
+
window.scrollTo(0, this.scrollPosition);
|
|
262
|
+
},
|
|
263
|
+
|
|
249
264
|
mouseDown(e){
|
|
250
265
|
if(!this.items || this.items.length <= 1)
|
|
251
266
|
return
|
|
@@ -301,11 +316,6 @@ export default{
|
|
|
301
316
|
overflow: hidden;
|
|
302
317
|
position: relative;
|
|
303
318
|
background-image: v-bind(bgImages[0]);
|
|
304
|
-
/*touch-action: none;*/
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
.comp.noTouchAction{
|
|
308
|
-
/*touch-action: none;*/
|
|
309
319
|
}
|
|
310
320
|
|
|
311
321
|
.comp img{
|
|
@@ -348,8 +358,21 @@ export default{
|
|
|
348
358
|
@apply bg-primary-500;
|
|
349
359
|
}
|
|
350
360
|
|
|
351
|
-
.
|
|
352
|
-
|
|
361
|
+
.htmlNoScroll{
|
|
362
|
+
min-height: 100.3%;
|
|
363
|
+
overscroll-behavior-y: none;
|
|
364
|
+
height: 100%;
|
|
365
|
+
overflow: hidden;
|
|
366
|
+
}
|
|
367
|
+
.bodyNoScroll{
|
|
368
|
+
overscroll-behavior: none;
|
|
369
|
+
overscroll-behavior-y: none;
|
|
370
|
+
overflow: hidden;
|
|
371
|
+
position: fixed;
|
|
372
|
+
width: 100%;
|
|
373
|
+
margin: 0;
|
|
374
|
+
max-height: 100%;
|
|
375
|
+
-webkit-overflow-scrolling: touch;
|
|
353
376
|
}
|
|
354
377
|
|
|
355
378
|
@media screen(md){
|