Showing
1 changed file
with
7 additions
and
9 deletions
@@ -5,9 +5,8 @@ | @@ -5,9 +5,8 @@ | ||
5 | * @date: 2015/10/19 | 5 | * @date: 2015/10/19 |
6 | */ | 6 | */ |
7 | 7 | ||
8 | -var $ = require('jquery'); | ||
9 | - | ||
10 | -// Hammer = require('yoho.hammer'); | 8 | +var $ = require('jquery'), |
9 | + Hammer = require('yoho.hammer'); | ||
11 | 10 | ||
12 | var $filter; | 11 | var $filter; |
13 | 12 | ||
@@ -113,8 +112,7 @@ function subClassifyTapEvt($this) { | @@ -113,8 +112,7 @@ function subClassifyTapEvt($this) { | ||
113 | 112 | ||
114 | //初始化筛选 | 113 | //初始化筛选 |
115 | function initFilter(opt) { | 114 | function initFilter(opt) { |
116 | - | ||
117 | - // var filterHammer; | 115 | + var filterHammer; |
118 | 116 | ||
119 | //注册回调 | 117 | //注册回调 |
120 | fCbFn = opt.fCbFn; | 118 | fCbFn = opt.fCbFn; |
@@ -127,8 +125,8 @@ function initFilter(opt) { | @@ -127,8 +125,8 @@ function initFilter(opt) { | ||
127 | 125 | ||
128 | $filter = $('.filter-mask'); | 126 | $filter = $('.filter-mask'); |
129 | 127 | ||
130 | - // filterHammer = new Hammer($filter[0]); | ||
131 | - $filter.on('touchend', function(e) { | 128 | + filterHammer = new Hammer($filter[0]); |
129 | + filterHammer.on('tap', function(e) { | ||
132 | var $this = $(e.target), | 130 | var $this = $(e.target), |
133 | $cur; | 131 | $cur; |
134 | 132 | ||
@@ -147,7 +145,7 @@ function initFilter(opt) { | @@ -147,7 +145,7 @@ function initFilter(opt) { | ||
147 | //tap classify | 145 | //tap classify |
148 | $cur = $this.closest('.classify-item'); | 146 | $cur = $this.closest('.classify-item'); |
149 | 147 | ||
150 | - e.stopPropagation(); | 148 | + e.srcEvent.stopPropagation(); |
151 | 149 | ||
152 | classifyTapEvt($cur); | 150 | classifyTapEvt($cur); |
153 | } | 151 | } |
@@ -183,4 +181,4 @@ exports.showFilter = showFilter; | @@ -183,4 +181,4 @@ exports.showFilter = showFilter; | ||
183 | 181 | ||
184 | exports.hideFilter = hideFilter; | 182 | exports.hideFilter = hideFilter; |
185 | 183 | ||
186 | -exports.resetFilter = resetFilter; | ||
184 | +exports.resetFilter = resetFilter; |
-
Please register or login to post a comment