|
@@ -187,11 +187,10 @@
|
|
toTop() {
|
|
toTop() {
|
|
this.hover = false;
|
|
this.hover = false;
|
|
this.showBackToTop = false;
|
|
this.showBackToTop = false;
|
|
- document.body.scrollTop = 0;
|
|
|
|
- document.documentElement.scrollTop = 0;
|
|
|
|
|
|
+ this.componentScrollBox.scrollTop = 0;
|
|
},
|
|
},
|
|
handleScroll() {
|
|
handleScroll() {
|
|
- const scrollTop = document.body.scrollTop || document.documentElement.scrollTop;
|
|
|
|
|
|
+ const scrollTop = this.componentScrollBox.scrollTop;
|
|
this.showBackToTop = scrollTop >= 0.5 * document.body.clientHeight;
|
|
this.showBackToTop = scrollTop >= 0.5 * document.body.clientHeight;
|
|
if (this.showHeader !== this.scrollTop > scrollTop) {
|
|
if (this.showHeader !== this.scrollTop > scrollTop) {
|
|
this.showHeader = this.scrollTop > scrollTop;
|
|
this.showHeader = this.scrollTop > scrollTop;
|