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/07/28 09:11:49 UTC

[10/43] incubator-weex git commit: * [html5] fix loading & release v0.11.56

* [html5] fix loading & release v0.11.56


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

Branch: refs/heads/0.16-dev
Commit: 166513dca8deb32e9d6d948ad1577b20e70096d4
Parents: d6730ef
Author: MrRaindrop <te...@gmail.com>
Authored: Tue Jul 4 18:56:59 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Tue Jul 4 18:56:59 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/mixins/base.js       | 16 ++++++++--------
 html5/render/vue/mixins/scrollable.js | 18 +++++++++++-------
 package.json                          |  2 +-
 packages/weex-vue-render/package.json |  2 +-
 4 files changed, 21 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/166513dc/html5/render/vue/mixins/base.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/mixins/base.js b/html5/render/vue/mixins/base.js
index aa77d1f..ff31cd0 100644
--- a/html5/render/vue/mixins/base.js
+++ b/html5/render/vue/mixins/base.js
@@ -37,7 +37,7 @@ import {
 
 // import { extractComponentStyle } from '../core'
 
-import config from '../config'
+// import config from '../config'
 
 let lazyloadWatched = false
 function watchLazyload () {
@@ -139,13 +139,13 @@ export default {
       return arr
     },
 
-    _getParentScroller () {
-      let parent = this
-      while (parent && config.scrollableTypes.indexOf(parent.$options._componentTag) <= -1) {
-        parent = parent.$options.parent
-      }
-      return parent
-    },
+    // _getParentScroller () {
+    //   let parent = this
+    //   while (parent && config.scrollableTypes.indexOf(parent.$options._componentTag) <= -1) {
+    //     parent = parent.$options.parent
+    //   }
+    //   return parent
+    // },
 
     _fireLazyload (el) {
       if (process.env.NODE_ENV === 'development') {

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/166513dc/html5/render/vue/mixins/scrollable.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/mixins/scrollable.js b/html5/render/vue/mixins/scrollable.js
index 4f7b03c..54c87dd 100644
--- a/html5/render/vue/mixins/scrollable.js
+++ b/html5/render/vue/mixins/scrollable.js
@@ -107,6 +107,14 @@ export default {
         this._innerWidth = rect.width
         this._innerHeight = rect.height
       }
+      const loadingEl = this._loading && this._loading.$el
+      const refreshEl = this._refresh && this._refresh.$el
+      if (loadingEl) {
+        this._innerHeight -= loadingEl.getBoundingClientRect().height
+      }
+      if (refreshEl) {
+        this._innerHeight -= refreshEl.getBoundingClientRect().height
+      }
       // inner width is always the viewport width somehow in horizontal
       // scoller, therefore the inner width should be reclaculated.
       if (this.scrollDirection === 'horizontal' && children) {
@@ -137,7 +145,7 @@ export default {
           this._innerLength = innerLength
           this._loadmoreReset = true
         }
-        if (this._loadmoreReset && this.reachBottom()) {
+        if (this._loadmoreReset && this.reachBottom(this.loadmoreoffset)) {
           this._loadmoreReset = false
           this.$emit('loadmore', event)
         }
@@ -149,19 +157,15 @@ export default {
       return (!!wrapper) && (wrapper.scrollTop <= 0)
     },
 
-    reachBottom () {
+    reachBottom (offset) {
       const wrapper = this.$refs.wrapper
       const inner = this.$refs.inner
-      const offset = parseInt(this.loadmoreoffset) * weex.config.env.scale
+      offset = parseInt(offset || 0) * weex.config.env.scale
 
       if (wrapper && inner) {
-        // const innerRect = inner.getBoundingClientRect()
-        // const wrapperRect = wrapper.getBoundingClientRect()
         const key = this.scrollDirection === 'horizontal'
           ? 'width'
           : 'height'
-        // const innerLength = innerRect[key]
-        // const wrapperLength = wrapperRect[key]
         const innerLength = this[`_inner${key[0].toUpperCase()}${key.substr(1)}`]
         const wrapperLength = this[`_wrapper${key[0].toUpperCase()}${key.substr(1)}`]
         const scrollOffset = this.scrollDirection === 'horizontal'

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/166513dc/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 1c9aa54..f99aec9 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
   "subversion": {
     "browser": "0.5.0",
     "framework": "0.20.6",
-    "vue-render": "0.11.55",
+    "vue-render": "0.11.56",
     "transformer": ">=0.1.5 <0.5"
   },
   "description": "A framework for building Mobile cross-platform UI",

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/166513dc/packages/weex-vue-render/package.json
----------------------------------------------------------------------
diff --git a/packages/weex-vue-render/package.json b/packages/weex-vue-render/package.json
index 19b31c3..6356cca 100644
--- a/packages/weex-vue-render/package.json
+++ b/packages/weex-vue-render/package.json
@@ -1,6 +1,6 @@
 {
   "name": "weex-vue-render",
-  "version": "0.11.55",
+  "version": "0.11.56",
   "description": "Weex built-in components for Vue 2.x.",
   "license": "Apache-2.0",
   "main": "dist/index.js",