Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-blk
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
1
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
jinhu.tung
9 years ago
Commit
5efadc5b8799dd94b89704579b52788932807d85
1 parent
fd5cf480
a tag replaced by span tag for avoiding eslint "class"
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
13 deletions
public/js/plugins/cascading-address.js
public/scss/components/_cascading-address.css
public/js/plugins/cascading-address.js
View file @
5efadc5
...
...
@@ -88,7 +88,7 @@ function fetchInitialData(evt, config, level) {
var
ulElement
=
$
(
'<ul/>'
),
liElement
,
a
Element
;
dist
Element
;
var
urlArr
;
...
...
@@ -102,8 +102,8 @@ function fetchInitialData(evt, config, level) {
liElement
=
$
(
'<li/>'
);
$
(
'<span class="check-icon iconfont"></span>'
).
appendTo
(
liElement
);
$
(
'<a/>'
,
{
href
:
'javascript:void(0);'
,
$
(
'<span/>'
,
{
class
:
'dist-name'
,
title
:
item
.
text
,
text
:
item
.
text
,
id
:
'area_'
+
item
.
value
...
...
@@ -119,25 +119,25 @@ function fetchInitialData(evt, config, level) {
}
// 选择区域
currPanel
.
off
(
'click'
,
'a'
).
on
(
'click'
,
'a'
,
function
()
{
aElement
=
$
(
this
);
currAreaId
=
aElement
.
attr
(
'id'
).
split
(
'_'
)[
1
];
currPanel
.
off
(
'click'
,
'.dist-name'
).
on
(
'click'
,
'.dist-name'
,
function
()
{
distElement
=
$
(
this
);
currAreaId
=
distElement
.
attr
(
'id'
).
split
(
'_'
)[
1
];
distItem
=
$
(
'#level_'
+
level
+
'_panel'
).
prev
();
if
(
a
Element
.
hasClass
(
'checked'
))
{
if
(
dist
Element
.
hasClass
(
'checked'
))
{
// TODO
//
a
Element.removeClass('checked');
//
dist
Element.removeClass('checked');
}
else
{
currPanel
.
find
(
'a.checked'
).
removeClass
(
'checked'
).
prev
().
hide
();
aElement
.
addClass
(
'checked'
).
prev
().
show
();
currPanel
.
find
(
'span.checked'
).
removeClass
(
'checked'
).
prev
().
hide
();
distElement
.
addClass
(
'checked'
).
prev
().
show
();
distItem
.
find
(
'.indicator-name'
)
.
html
(
a
Element
.
text
())
.
html
(
dist
Element
.
text
())
.
next
()
.
val
(
currAreaId
);
// 填充下一级
if
(
level
<
0
)
{
level
=
a
Element
.
parents
(
'.items-panel'
).
attr
(
'id'
).
split
(
'_'
)[
1
];
level
=
dist
Element
.
parents
(
'.items-panel'
).
attr
(
'id'
).
split
(
'_'
)[
1
];
}
urlArr
=
config
.
url
.
split
(
config
.
resources
+
'/'
);
...
...
public/scss/components/_cascading-address.css
View file @
5efadc5
...
...
@@ -60,7 +60,7 @@
margin-right
:
0
;
}
a
{
.dist-name
{
font-size
:
12px
;
display
:
inline-block
;
width
:
50px
;
...
...
@@ -69,6 +69,10 @@
white-space
:
nowrap
;
overflow
:
hidden
;
text-align
:
left
;
&:hover
{
cursor
:
pointer
;
}
}
.checked
{
...
...
Please
register
or
login
to post a comment