diff options
Diffstat (limited to 'public/js/gogs.js')
-rw-r--r-- | public/js/gogs.js | 11 |
1 files changed, 8 insertions, 3 deletions
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 <span> 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 () { |