feat(web): use filled icon when has cnt in click_zan_block
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Baoshuo Ren 2022-10-11 21:58:37 +08:00
parent f77f8a0a03
commit 8579e31c19
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A

View File

@ -285,12 +285,22 @@ $.fn.click_zan_block = function() {
if (isNaN(cnt)) { if (isNaN(cnt)) {
return; return;
} }
var up_icon_html = isBootstrap5Page
? '<i class="bi bi-hand-thumbs-up"></i>'
: '<span class="glyphicon glyphicon-thumbs-up"></span>';
var down_icon_html = isBootstrap5Page
? '<i class="bi bi-hand-thumbs-down"></i>'
: '<span class="glyphicon glyphicon-thumbs-down"></span>';
if (val == 1) { if (val == 1) {
$(this).addClass('uoj-click-zan-block-cur-up'); $(this).addClass('uoj-click-zan-block-cur-up');
up_icon_html = '<i class="bi bi-hand-thumbs-up-fill"></i>';
} else if (val == 0) { } else if (val == 0) {
$(this).addClass('uoj-click-zan-block-cur-zero'); $(this).addClass('uoj-click-zan-block-cur-zero');
} else if (val == -1) { } else if (val == -1) {
$(this).addClass('uoj-click-zan-block-cur-down'); $(this).addClass('uoj-click-zan-block-cur-down');
down_icon_html = '<i class="bi bi-hand-thumbs-down-fill"></i>';
} else { } else {
return; return;
} }
@ -302,13 +312,6 @@ $.fn.click_zan_block = function() {
$(this).addClass('uoj-click-zan-block-negative'); $(this).addClass('uoj-click-zan-block-negative');
} }
var up_icon_html = isBootstrap5Page
? '<i class="bi bi-hand-thumbs-up"></i>'
: '<span class="glyphicon glyphicon-thumbs-up"></span>';
var down_icon_html = isBootstrap5Page
? '<i class="bi bi-hand-thumbs-down"></i>'
: '<span class="glyphicon glyphicon-thumbs-down"></span>';
var node = this; var node = this;
var up_node = $('<a href="#" class="uoj-click-zan-up">'+up_icon_html+(show_text ? uojLocale('click-zan::good') : '')+'</a>').click(function(e) { var up_node = $('<a href="#" class="uoj-click-zan-up">'+up_icon_html+(show_text ? uojLocale('click-zan::good') : '')+'</a>').click(function(e) {
e.preventDefault(); e.preventDefault();