Authored by xuqi

filter html modify

... ... @@ -7,7 +7,7 @@
var $ = require('yoho.zepto');
var $filter = $('.filter-mask, .filter-body');
var $filter = $('.filter-mask');
var $classify = $filter.find('.classify'),
$subClassify = $filter.find('.sub-classify');
... ... @@ -33,9 +33,11 @@ function registerCbFn(cb) {
$classify.children(':first-child').addClass('active'); //T:不在HTML中使用{{#if @first}}active{{/if}}来初始化active为避免sub设置高度时的闪烁
//classify switch
$classify.delegate('.classify-item', 'tap', function() {
$classify.delegate('.classify-item', 'tap', function(e) {
var $this = $(this);
e.stopPropagation();
if ($this.hasClass('active')) {
return;
}
... ... @@ -46,7 +48,7 @@ $classify.delegate('.classify-item', 'tap', function() {
});
//点击Mask隐藏筛选界面
$filter.filter('.filter-mask').tap(function() {
$filter.tap(function() {
hideFilter();
});
... ...
{{# filter}}
<div class="filter-mask hide"></div>
<div class="filter-body hide">
<ul class="classify">
{{#each classify}}
<li class="classify-item">
<p class="shower{{#if default}} default{{/if}}">
<span class="title">{{title}}:</span>
{{name}}
</p>
<ul class="sub-classify" data-type={{dataType}}>
{{# subs}}
<li {{#if chosed}}class=chosed{{/if}} data-id={{dataId}}>
{{name}}
<i class="iconfont chosed-icon">&#xe617;</i>
</li>
{{/ subs}}
</ul>
</li>
{{/each}}
</ul>
<div class="filter-mask hide">
<div class="filter-body">
<ul class="classify">
{{#each classify}}
<li class="classify-item">
<p class="shower{{#if default}} default{{/if}}">
<span class="title">{{title}}:</span>
{{name}}
</p>
<ul class="sub-classify" data-type={{dataType}}>
{{# subs}}
<li {{#if chosed}}class=chosed{{/if}} data-id={{dataId}}>
{{name}}
<i class="iconfont chosed-icon">&#xe617;</i>
</li>
{{/ subs}}
</ul>
</li>
{{/each}}
</ul>
</div>
</div>
{{/ filter}}
\ No newline at end of file
... ...