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/06/07 08:06:14 UTC

[37/50] incubator-weex git commit: + [ios] fixbug: cycle slider

+ [ios] fixbug: cycle slider


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

Branch: refs/heads/dev
Commit: a4cc8dfd9745aeb3efc4eabbffd1a00e771d5067
Parents: 8a1653c
Author: 齐山 <su...@163.com>
Authored: Fri May 26 18:03:48 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Fri Jun 2 11:10:04 2017 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/a4cc8dfd/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m b/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m
index 3265308..517af72 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m
+++ b/ios/sdk/WeexSDK/Sources/Component/WXCycleSliderComponent.m
@@ -586,9 +586,10 @@ typedef NS_ENUM(NSInteger, Direction) {
 
 - (void)recycleSliderView:(WXRecycleSliderView *)recycleSliderView didScrollToItemAtIndex:(NSInteger)index
 {
-    self.currentIndex = index;
-    if (_sliderChangeEvent) {
+    
+    if (_sliderChangeEvent && index != self.currentIndex) {
         [self fireEvent:@"change" params:@{@"index":@(index)} domChanges:@{@"attrs": @{@"index": @(index)}}];
+        self.currentIndex = index;
     }
 }