From 9074fc0e30773dfe68556f1fc729988f6961ff2d Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 18 Nov 2017 08:29:47 +0900 Subject: [PATCH] Fix bug --- src/web/app/desktop/tags/home.tag | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/web/app/desktop/tags/home.tag b/src/web/app/desktop/tags/home.tag index 7a23ad242..36e94ecc5 100644 --- a/src/web/app/desktop/tags/home.tag +++ b/src/web/app/desktop/tags/home.tag @@ -241,11 +241,13 @@ })); } - this.containerTop = this.refs.main.getBoundingClientRect().top; - this.headerHight = this.root.getBoundingClientRect().top; + if (!this.opts.customize) { + this.containerTop = this.refs.main.getBoundingClientRect().top; + this.headerHight = this.root.getBoundingClientRect().top; - window.addEventListener('scroll', this.followWidgets); - window.addEventListener('resize', this.followWidgets); + window.addEventListener('scroll', this.followWidgets); + window.addEventListener('resize', this.followWidgets); + } }); this.on('unmount', () => { @@ -253,8 +255,10 @@ widget.unmount(); }); - window.removeEventListener('scroll', this.followWidgets); - window.removeEventListener('resize', this.followWidgets); + if (!this.opts.customize) { + window.removeEventListener('scroll', this.followWidgets); + window.removeEventListener('resize', this.followWidgets); + } }); this.followWidgets = () => {