You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by da...@apache.org on 2017/08/03 13:43:38 UTC

[02/12] incubator-weex git commit: * [html5] add scrollable property in scroller

* [html5] add scrollable property in scroller


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

Branch: refs/heads/0.16-dev
Commit: b0520a8a2d33275e52e305f217a0a5401deb14ef
Parents: d601088
Author: erha19 <fa...@gmail.com>
Authored: Mon Jul 31 16:24:44 2017 +0800
Committer: erha19 <fa...@gmail.com>
Committed: Mon Jul 31 16:24:44 2017 +0800

----------------------------------------------------------------------
 html5/render/vue/components/scrollable/scroller.js | 9 ++++++++-
 html5/render/vue/components/scrollable/style.css   | 5 +++++
 2 files changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b0520a8a/html5/render/vue/components/scrollable/scroller.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/scrollable/scroller.js b/html5/render/vue/components/scrollable/scroller.js
index cda95b8..4fe998c 100644
--- a/html5/render/vue/components/scrollable/scroller.js
+++ b/html5/render/vue/components/scrollable/scroller.js
@@ -35,11 +35,15 @@ function getScroller (weex) {
         validator (value) {
           return ['horizontal', 'vertical'].indexOf(value) !== -1
         }
+      },
+      scrollable: {
+        type: [Boolean],
+        default: true
       }
     },
-
     computed: {
       wrapperClass () {
+        console.log(this.scrollable)
         const classArray = ['weex-scroller', 'weex-scroller-wrapper', 'weex-ct']
         if (this.scrollDirection === 'horizontal') {
           classArray.push('weex-scroller-horizontal')
@@ -47,6 +51,9 @@ function getScroller (weex) {
         else {
           classArray.push('weex-scroller-vertical')
         }
+        if (!this.scrollable) {
+          classArray.push('weex-scroller-disabled')
+        }
         return classArray.join(' ')
       }
     },

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b0520a8a/html5/render/vue/components/scrollable/style.css
----------------------------------------------------------------------
diff --git a/html5/render/vue/components/scrollable/style.css b/html5/render/vue/components/scrollable/style.css
index c4e1498..c90d2ea 100644
--- a/html5/render/vue/components/scrollable/style.css
+++ b/html5/render/vue/components/scrollable/style.css
@@ -58,6 +58,11 @@ body > .weex-waterfall {
   overflow-y: hidden;
 }
 
+.weex-scroller-wrapper.weex-scroller-disabled {
+  overflow-x: hidden;
+  overflow-y: hidden;
+}
+
 .weex-scroller-horizontal .weex-scroller-inner {
   -webkit-flex-direction: row;
       -ms-flex-direction: row;