diff --git a/.sdk-repos/sdk-javascript-v5 b/.sdk-repos/sdk-javascript-v5 new file mode 160000 index 000000000..c5d2c2256 --- /dev/null +++ b/.sdk-repos/sdk-javascript-v5 @@ -0,0 +1 @@ +Subproject commit c5d2c2256ccd1de2ba4371d3044a3097ae0c7692 diff --git a/src/.vuepress/theme/Layout.vue b/src/.vuepress/theme/Layout.vue index 0c53d5ac5..264c7e3fc 100644 --- a/src/.vuepress/theme/Layout.vue +++ b/src/.vuepress/theme/Layout.vue @@ -85,7 +85,7 @@ export default { path: this.$route.path }); }, - onWindowResize() { + computeContentHeight() { this.setContainerPadding(); setTimeout(() => { this.computeSidebarHeight(); @@ -143,10 +143,10 @@ export default { } }, mounted() { - if (this.$page.frontmatter.type !== 'page') { - this.$router.replace(getFirstValidChild(this.$page, this.$site.pages)); - return; - } + this.$router.afterEach(this.computeContentHeight); + window.addEventListener('resize', this.computeContentHeight.bind(this)); + window.addEventListener('scroll', this.computeSidebarHeight.bind(this)); + // TODO condition isSupported() const copy = new Clipboard('.md-clipboard', { target: trigger => { @@ -156,9 +156,11 @@ export default { copy.on('success', this.onCodeCopied); - window.addEventListener('resize', this.onWindowResize); - window.addEventListener('scroll', this.computeSidebarHeight); - this.onWindowResize(); + if (this.$page.frontmatter.type !== 'page') { + this.$router.replace(getFirstValidChild(this.$page, this.$site.pages)); + } + + this.computeContentHeight(); } };