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
郝肖肖
8 years ago
Commit
ed48368974a7a1a27a9977c13df1a7d3ca6a9456
1 parent
faf0d9d7
资讯收藏样式调整
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
38 deletions
apps/editorial/views/action/detail.hbs
public/js/editorial/detail.page.js
public/scss/components/_share.css
public/scss/editorial/_detail.css
public/scss/editorial/_msg.css
apps/editorial/views/action/detail.hbs
View file @
ed48368
...
...
@@ -126,10 +126,10 @@
<span
class=
"like-num"
>
{{
likeNum
}}
</span>
</a>
</li>
<li
id=
"collect-btn"
class=
"sort-collect
{{#
isCollected
}}
collected
{{/
isCollected
}}
"
>
<li
id=
"collect-btn"
class=
"
collect-btn
sort-collect
{{#
isCollected
}}
collected
{{/
isCollected
}}
"
>
<a
href=
"javascript:;"
>
<i
class=
"iconfont"
>

</i>
<span>
收藏
</span>
<span>
{{#
isCollected
}}
已
{{/
isCollected
}}
收藏
</span>
</a>
</li>
</ul>
...
...
public/js/editorial/detail.page.js
View file @
ed48368
...
...
@@ -26,6 +26,7 @@ var $commentList = $commentArea.find('.comments-wrap'),
next
=
$
(
'.chapter-right'
).
find
(
'a'
);
require
(
'../plugins/share'
);
require
(
'../common/return-top'
);
require
(
'../common/header'
);
lazyLoad
(
$
(
'img'
));
...
...
@@ -72,16 +73,19 @@ $('#prise-btn').click(function() {
$
(
'#collect-btn'
).
click
(
function
()
{
var
collecting
=
false
,
url
,
isfav
=
false
,
$this
=
$
(
this
);
if
(
collecting
)
{
return
;
}
if
(
$this
.
hasClass
(
'collected'
))
{
isfav
=
false
;
// 取消收藏
url
=
'/editorial/info/cancelcollect'
;
}
else
{
isfav
=
true
;
// 收藏
url
=
'/editorial/info/collect'
;
...
...
@@ -95,6 +99,7 @@ $('#collect-btn').click(function() {
}
}).
then
(
function
(
data
)
{
if
(
data
.
code
===
200
)
{
$this
.
find
(
'span'
).
html
((
isfav
?
'已'
:
''
)
+
'收藏'
);
new
_alert
(
data
.
message
).
show
();
$this
.
toggleClass
(
'collected'
);
}
else
if
(
data
.
code
===
400
)
{
...
...
@@ -104,8 +109,18 @@ $('#collect-btn').click(function() {
}
collecting
=
false
;
});
}).
bind
(
'mouseenter mouseleave'
,
function
()
{
$
(
this
).
toggleClass
(
'hover'
);
}).
hover
(
function
()
{
var
$this
=
$
(
this
);
if
(
$this
.
hasClass
(
'collected'
))
{
$this
.
find
(
'span'
).
html
(
'取消收藏'
);
}
},
function
()
{
var
$this
=
$
(
this
);
if
(
$this
.
hasClass
(
'collected'
))
{
$this
.
find
(
'span'
).
html
(
'已收藏'
);
}
});
function
showComment
()
{
...
...
public/scss/components/_share.css
View file @
ed48368
...
...
@@ -22,8 +22,8 @@
position
:
absolute
;
margin-top
:
9px
;
text-align
:
center
;
top
:
15px
;
left
:
10px
;
top
:
10px
;
left
:
23px
;
z-index
:
2
;
h2
{
...
...
public/scss/editorial/_detail.css
View file @
ed48368
...
...
@@ -284,6 +284,8 @@
float
:
left
;
margin
:
0
15px
;
cursor
:
pointer
;
color
:
#999
!important
;
font-size
:
14px
;
a
{
position
:
relative
;
...
...
@@ -291,15 +293,13 @@
padding
:
0
10px
;
height
:
36px
;
line-height
:
36px
;
color
:
#535353
;
font-size
:
0
;
text-align
:
left
;
color
:
inherit
;
}
span
{
display
:
inline-block
;
font-style
:
normal
;
font-size
:
14px
;
}
i
{
...
...
@@ -307,7 +307,11 @@
font-style
:
normal
;
margin
:
0
5px
0
0
;
font-size
:
18px
;
opacity
:
0.5
;
}
&
.liked
,
&
.collected
{
color
:
#1b1b1b
!important
;
}
}
...
...
@@ -315,15 +319,6 @@
display
:
none
;
}
.like-status.liked
i
,
.like-status.hover
i
{
opacity
:
0.5
;
}
.like-statis.hover
.like-num
{
color
:
#000
;
}
.sort-collect
a
{
i
{
width
:
21px
;
...
...
@@ -331,24 +326,6 @@
top
:
2px
;
}
}
.sort-collect.collected
a
{
i
{
opacity
:
1
;
}
.cancel-collect
{
display
:
inline
;
}
}
.sort-collect.hover
i
{
opacity
:
1
;
}
.sort-collect.hover
span
{
color
:
#000
;
}
}
}
...
...
public/scss/editorial/_msg.css
View file @
ed48368
...
...
@@ -5,13 +5,13 @@
.msg-left
{
position
:
relative
;
float
:
left
;
width
:
180px
;
height
:
30px
;
margin-right
:
90px
;
line-height
:
30px
;
text-align
:
center
;
border-bottom
:
1px
solid
#bbb
;
color
:
#999
;
padding
:
0
10px
;
}
.msg-right
{
...
...
Please
register
or
login
to post a comment