You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ta...@apache.org on 2017/05/25 02:46:17 UTC

[35/50] incubator-weex git commit: * [html5] fix scrollToElement in body.

* [html5] fix scrollToElement in body.


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/6ef1d962
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/6ef1d962
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/6ef1d962

Branch: refs/heads/0.13-dev
Commit: 6ef1d96269cd53742c805cd7f32429e71a1a7ed0
Parents: 9c7da7c
Author: MrRaindrop <te...@gmail.com>
Authored: Tue May 16 00:28:54 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Tue May 16 00:28:54 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/modules/dom.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/6ef1d962/html5/render/vue/modules/dom.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/modules/dom.js b/html5/render/vue/modules/dom.js
index f82604f..6d1e4dc 100644
--- a/html5/render/vue/modules/dom.js
+++ b/html5/render/vue/modules/dom.js
@@ -114,7 +114,7 @@ export default {
       const elRect = el.getBoundingClientRect()
 
       const dir = dSuffix.toLowerCase()
-      let offset = ct[`scroll${dSuffix}`] + elRect[dir] - ctRect[dir]
+      let offset = (isWindow ? 0 : ct[`scroll${dSuffix}`]) + elRect[dir] - ctRect[dir]
       // let offset = el[`offset${dSuffix}`]
 
       if (options) {