mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 21:38:13 +00:00
Scroll lock przy otwartym modalu
This commit is contained in:
@@ -1,34 +1,34 @@
|
||||
import { defineComponent, h } from 'vue';
|
||||
import imageMixin from './imageMixin';
|
||||
|
||||
export default defineComponent({
|
||||
mixins: [imageMixin],
|
||||
|
||||
data() {
|
||||
return {
|
||||
icons: {
|
||||
arrow: this.getIcon('arrow-asc'),
|
||||
},
|
||||
|
||||
showReturnButton: false,
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
scrollToTop() {
|
||||
window.scrollTo({ top: 0 });
|
||||
},
|
||||
|
||||
handleScroll() {
|
||||
this.showReturnButton = window.scrollY > window.innerHeight * 0.35;
|
||||
},
|
||||
},
|
||||
|
||||
activated() {
|
||||
window.addEventListener('scroll', this.handleScroll);
|
||||
},
|
||||
|
||||
deactivated() {
|
||||
window.removeEventListener('scroll', this.handleScroll);
|
||||
},
|
||||
});
|
||||
import { defineComponent, h } from 'vue';
|
||||
import imageMixin from './imageMixin';
|
||||
|
||||
export default defineComponent({
|
||||
mixins: [imageMixin],
|
||||
|
||||
data() {
|
||||
return {
|
||||
icons: {
|
||||
arrow: this.getIcon('arrow-asc'),
|
||||
},
|
||||
|
||||
showReturnButton: false,
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
scrollToTop() {
|
||||
window.scrollTo({ top: 0 });
|
||||
},
|
||||
|
||||
handleScroll() {
|
||||
this.showReturnButton = window.scrollY > window.innerHeight * 0.35;
|
||||
},
|
||||
},
|
||||
|
||||
activated() {
|
||||
window.addEventListener('wheel', this.handleScroll);
|
||||
},
|
||||
|
||||
deactivated() {
|
||||
window.removeEventListener('wheel', this.handleScroll);
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user