From 91b89b79d270e0a13c262b0e31044d348564c236 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 26 Jul 2018 04:29:09 +0900 Subject: [PATCH] Fix bug --- .../views/components/ui.header.nav.vue | 11 +++++----- .../desktop/views/components/ui.header.vue | 20 ++++++++++--------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/client/app/desktop/views/components/ui.header.nav.vue b/src/client/app/desktop/views/components/ui.header.nav.vue index f46edecb1..f01aade30 100644 --- a/src/client/app/desktop/views/components/ui.header.nav.vue +++ b/src/client/app/desktop/views/components/ui.header.nav.vue @@ -84,12 +84,11 @@ export default Vue.extend({ (this as any).os.new(MkGameWindow); }, - goToTop(e: HTMLElement) { - if (e.classList.contains('active')) - window.scrollTo({ - top: 0, - behavior: 'smooth' - }); + goToTop() { + window.scrollTo({ + top: 0, + behavior: 'smooth' + }); } } }); diff --git a/src/client/app/desktop/views/components/ui.header.vue b/src/client/app/desktop/views/components/ui.header.vue index d2848eac0..1ed5c3523 100644 --- a/src/client/app/desktop/views/components/ui.header.vue +++ b/src/client/app/desktop/views/components/ui.header.vue @@ -45,14 +45,7 @@ export default Vue.extend({ XPost, XClock, }, - methods: { - goToTop() { - window.scrollTo({ - top: 0, - behavior: 'smooth' - }); - } - }, + mounted() { this.$store.commit('setUiHeaderHeight', 48); @@ -104,7 +97,16 @@ export default Vue.extend({ }, 2500); } } - } + }, + + methods: { + goToTop() { + window.scrollTo({ + top: 0, + behavior: 'smooth' + }); + } + }, });