...
|
...
|
@@ -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() {
|
...
|
...
|
|