fix: 82ca33db5e
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Baoshuo Ren 2022-10-03 21:04:20 +08:00
parent 82ca33db5e
commit af2b8a437a
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
2 changed files with 5 additions and 2 deletions

View File

@ -24,6 +24,7 @@
$id = $_POST['id'];
$delta = $_POST['delta'];
$type = $_POST['type'];
$show_text = isset($_POST['show-text']) && $_POST['show-text'] != 'false';
switch ($type) {
case 'B':
@ -65,4 +66,4 @@
$cnt = $row['zan'];
}
?>
<?= getClickZanBlock($type, $id, $cnt, $cur) ?>
<?= getClickZanBlock($type, $id, $cnt, $cur, $show_text) ?>

View File

@ -259,11 +259,13 @@ $.fn.uoj_blog_tag = function() {
// click zan
function click_zan(zan_id, zan_type, zan_delta, node) {
var loading_node = $('<div class="uoj-click-zan-block text-muted">loading...</div>');
var show_text = Boolean($(node).data('show-text'));
$(node).replaceWith(loading_node);
$.post(zan_link + '/click-zan', {
id : zan_id,
delta : zan_delta,
type : zan_type
type : zan_type,
'show-text': show_text,
}, function(ret) {
$(loading_node).replaceWith($(ret).click_zan_block());
}).fail(function() {