You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by so...@apache.org on 2017/03/31 07:28:46 UTC
[11/50] [abbrv] incubator-weex git commit: * [html5] fix appear
direction according to native direction definition.
* [html5] fix appear direction according to native direction definition.
Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/e1d333db
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/e1d333db
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/e1d333db
Branch: refs/heads/0.12-dev
Commit: e1d333db38f9ea0b6da8264334330c30cf07324e
Parents: 40108df
Author: MrRaindrop <te...@gmail.com>
Authored: Thu Mar 23 15:22:13 2017 +0800
Committer: MrRaindrop <te...@gmail.com>
Committed: Thu Mar 23 15:22:13 2017 +0800
----------------------------------------------------------------------
html5/render/vue/utils/component.js | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/e1d333db/html5/render/vue/utils/component.js
----------------------------------------------------------------------
diff --git a/html5/render/vue/utils/component.js b/html5/render/vue/utils/component.js
index 2a8ff6a..f1ffc50 100644
--- a/html5/render/vue/utils/component.js
+++ b/html5/render/vue/utils/component.js
@@ -74,7 +74,7 @@ export function watchAppear (context) {
if (on.appear.fn) {
on.appear = on.appear.fn
}
- on.appear(createEvent(context.$el, 'appear', { direction: 'down' }))
+ on.appear(createEvent(context.$el, 'appear', { direction: null }))
}
const handler = throttle(event => {
const visible = isElementVisible(context.$el, isWindow ? document.body : container)
@@ -95,7 +95,8 @@ export function watchAppear (context) {
}
const scrollTop = container.scrollTop || window.pageYOffset
listener && listener(createEvent(context.$el, type, {
- direction: scrollTop > lastScrollTop ? 'down' : 'up'
+ direction: scrollTop < lastScrollTop ? 'down'
+ : scrollTop > lastScrollTop ? 'up' : null
}))
lastScrollTop = scrollTop
}