From 71753cdd468fffd3ba6b5ff548084dedf2d137ef Mon Sep 17 00:00:00 2001 From: Unknwon Date: Wed, 22 Mar 2017 16:20:31 -0400 Subject: templates/label: another minor style improve --- public/js/gogs.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'public/js') diff --git a/public/js/gogs.js b/public/js/gogs.js index fd6a7d85..378b0bbd 100644 --- a/public/js/gogs.js +++ b/public/js/gogs.js @@ -108,16 +108,21 @@ function initCommentForm() { }); } + // Add   to each unselected label to keep UI looks good. + // This should be added directly to HTML but somehow just get empty on this page. + $labelMenu.find('.item:not(.no-select) .octicon:not(.octicon-check)').each(function () { + $(this).html(' '); + }) $labelMenu.find('.item:not(.no-select)').click(function () { if ($(this).hasClass('checked')) { $(this).removeClass('checked'); - $(this).find('.octicon').removeClass('octicon-check'); + $(this).find('.octicon').removeClass('octicon-check').html(' '); if (hasLabelUpdateAction) { updateIssueMeta($labelMenu.data('update-url'), "detach", $(this).data('id')); } } else { $(this).addClass('checked'); - $(this).find('.octicon').addClass('octicon-check'); + $(this).find('.octicon').addClass('octicon-check').html(''); if (hasLabelUpdateAction) { updateIssueMeta($labelMenu.data('update-url'), "attach", $(this).data('id')); } @@ -147,7 +152,7 @@ function initCommentForm() { $(this).parent().find('.item').each(function () { $(this).removeClass('checked'); - $(this).find('.octicon').removeClass('octicon-check'); + $(this).find('.octicon').removeClass('octicon-check').html(' '); }); $list.find('.item').each(function () { -- cgit v1.2.3