Showing
6 changed files
with
10 additions
and
15 deletions
@@ -7,8 +7,8 @@ | @@ -7,8 +7,8 @@ | ||
7 | </a> | 7 | </a> |
8 | <div class="content">{{intro}}</div> | 8 | <div class="content">{{intro}}</div> |
9 | <div class="msg-app"> | 9 | <div class="msg-app"> |
10 | - <span class="like-comment"> | ||
11 | - <i class="iconfont like-icon {{#if isPraise}}liked{{/if}}"></i> | 10 | + <span class="like-comment {{#if isPraise}}liked{{/if}}"> |
11 | + <i class="iconfont like-icon"></i> | ||
12 | <b class="like-num brown-light font">{{praise_num}}</b> | 12 | <b class="like-num brown-light font">{{praise_num}}</b> |
13 | </span> | 13 | </span> |
14 | </div> | 14 | </div> |
@@ -33,14 +33,12 @@ $('.editorial-index-page').on('click', '.like-icon', function() { | @@ -33,14 +33,12 @@ $('.editorial-index-page').on('click', '.like-icon', function() { | ||
33 | }).then(function(data) { | 33 | }).then(function(data) { |
34 | if (data.code === 200) { | 34 | if (data.code === 200) { |
35 | $this.next('b').html(data.data); | 35 | $this.next('b').html(data.data); |
36 | - $this.toggleClass('liked'); | 36 | + $this.parent('.like-comment').toggleClass('liked'); |
37 | } else { | 37 | } else { |
38 | new _alert(data.message).show(); | 38 | new _alert(data.message).show(); |
39 | } | 39 | } |
40 | 40 | ||
41 | }); | 41 | }); |
42 | -}).on('mouseenter mouseleave', '.like-icon', function() { | ||
43 | - $(this).closest('.like').toggleClass('hover'); | ||
44 | }); | 42 | }); |
45 | 43 | ||
46 | $('.msg-title').each(function() { | 44 | $('.msg-title').each(function() { |
@@ -35,14 +35,12 @@ $('.editorial-list-page').on('click', '.like-icon', function() { | @@ -35,14 +35,12 @@ $('.editorial-list-page').on('click', '.like-icon', function() { | ||
35 | } | 35 | } |
36 | }).then(function(data) { | 36 | }).then(function(data) { |
37 | if (data.code === 200) { | 37 | if (data.code === 200) { |
38 | - $this.toggleClass('liked'); | 38 | + $this.parent('.like-comment').toggleClass('liked'); |
39 | $this.next('b').html(data.data); | 39 | $this.next('b').html(data.data); |
40 | } else { | 40 | } else { |
41 | new _alert(data.message).show(); | 41 | new _alert(data.message).show(); |
42 | } | 42 | } |
43 | }); | 43 | }); |
44 | -}).on('mouseenter mouseleave', '.like-icon', function() { | ||
45 | - $(this).closest('.like').toggleClass('hover'); | ||
46 | }); | 44 | }); |
47 | 45 | ||
48 | $('.msg-title').each(function() { | 46 | $('.msg-title').each(function() { |
@@ -88,15 +88,14 @@ | @@ -88,15 +88,14 @@ | ||
88 | 88 | ||
89 | .like-comment { | 89 | .like-comment { |
90 | color: #999; | 90 | color: #999; |
91 | - cursor: pointer; | ||
92 | font-size: 14px; | 91 | font-size: 14px; |
93 | 92 | ||
93 | + &.liked { | ||
94 | + color: #1b1b1b; | ||
95 | + } | ||
96 | + | ||
94 | .like-icon { | 97 | .like-icon { |
95 | cursor: pointer; | 98 | cursor: pointer; |
96 | - | ||
97 | - &.liked { | ||
98 | - color: #000; | ||
99 | - } | ||
100 | } | 99 | } |
101 | } | 100 | } |
102 | 101 |
-
Please register or login to post a comment