Toggle navigation
Toggle navigation
This project
Loading...
Sign in
chenchao
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to dashboard
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
xuqi
2015-10-21 13:35:42 +0800
Commit
fdad1658d18483e9c61e665f94b7d3cd5de194d5
1 parent
210b3e12
filter logic/style change
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
33 deletions
static/js/plugin/filter.js
static/sass/_filter.scss
template/m.yohobuy.com/partials/filter.phtml
static/js/plugin/filter.js
View file @
fdad165
...
...
@@ -7,7 +7,7 @@
var
$
=
require
(
'yoho.zepto'
);
var
$filter
=
$
(
'
#yoho-filter
'
);
var
$filter
=
$
(
'
.filter-mask, .filter-body
'
);
var
$classify
=
$filter
.
find
(
'.classify'
),
$subClassify
=
$filter
.
find
(
'.sub-classify'
);
...
...
@@ -29,9 +29,6 @@ function registerCbFn(cb) {
cbFn
=
cb
;
}
//初始化sub高度与classify高度一致
$subClassify
.
height
(
$classify
.
height
());
//设置完高度后显示sub并设置选中
$classify
.
children
(
':first-child'
).
addClass
(
'active'
);
//T:不在HTML中使用{{#if @first}}active{{/if}}来初始化active为避免sub设置高度时的闪烁
...
...
@@ -49,7 +46,7 @@ $classify.delegate('.classify-item', 'touchstart', function() {
});
//点击Mask隐藏筛选界面
$filter
.
children
(
'.filter-mask'
).
click
(
function
()
{
$filter
.
filter
(
'.filter-mask'
).
click
(
function
()
{
hideFilter
();
});
...
...
static/sass/_filter.scss
View file @
fdad165
...
...
@@ -11,17 +11,18 @@
}
.filter-body
{
position
:
relative
;
background
:
#fff
;
color
:
#000
;
cursor
:
pointer
;
font-size
:
14px
;
height
:
440px
;
.classify
{
width
:
50%
;
height
:
100%
;
background
:
#f8f8f8
;
>
li
{
background
:
#f8f8f8
;
height
:
60px
;
line-height
:
60px
;
...
...
@@ -56,6 +57,7 @@
position
:
absolute
;
display
:
none
;
width
:
50%
;
height
:
440px
;
padding-left
:
15px
;
left
:
50%
;
top
:
0
;
...
...
@@ -68,10 +70,6 @@
overflow
:
hidden
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
&
:last-child
{
border-bottom
:
none
;
}
}
.chosed-icon
{
...
...
template/m.yohobuy.com/partials/filter.phtml
View file @
fdad165
{
{#
filter
}
}
<div
id=
"yoho-filter"
>
<div
class=
"filter-mask"
></div>
<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"
>
617
;</i>
</li>
{
{/
subs
}
}
</ul>
</li>
{
{/each
}
}
</ul>
</div>
<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"
>
617
;</i>
</li>
{
{/
subs
}
}
</ul>
</li>
{
{/each
}
}
</ul>
</div>
{
{/
filter
}
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment