diff --git a/web/app/controllers/click_zan.php b/web/app/controllers/click_zan.php index 05817fe..a43437a 100644 --- a/web/app/controllers/click_zan.php +++ b/web/app/controllers/click_zan.php @@ -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']; } ?> - \ No newline at end of file + diff --git a/web/js/uoj.js b/web/js/uoj.js index 1413ad9..695c71f 100644 --- a/web/js/uoj.js +++ b/web/js/uoj.js @@ -259,11 +259,13 @@ $.fn.uoj_blog_tag = function() { // click zan function click_zan(zan_id, zan_type, zan_delta, node) { var loading_node = $('
loading...
'); + 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() {