Authored by xuqi

filter with miss chosed status

... ... @@ -12,9 +12,18 @@ var $filter;
var fCbFn, hCbFn; //筛选和关闭的回调
var missStatus; //是否忽略选中状态
//隐藏筛选界面
function hideFilter() {
$filter.addClass('hide');
if (missStatus) {
//重置一级筛选项选中状态
$filter.find('.classify-item.active').removeClass('active');
$filter.find('.classify-item:first-child').addClass('active');
}
}
//显示筛选界面
... ... @@ -71,15 +80,23 @@ function subClassifyTapEvt($this) {
}
hideFilter();
//重置选中状态
if (missStatus) {
$this.removeClass('chosed');
$sub.children(':first-child').addClass('chosed');
}
}
//初始化筛选
function initFilter(cb) {
function initFilter(opt) {
var filterHammer;
//注册回调
fCbFn = cb.fCbFn;
hCbFn = cb.hCbFn;
fCbFn = opt.fCbFn;
hCbFn = opt.hCbFn;
missStatus = opt.missStatus;
$filter = $('.filter-mask');
... ...