aboutsummaryrefslogtreecommitdiff
path: root/public/js/gogs.js
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2017-03-22 16:20:31 -0400
committerUnknwon <u@gogs.io>2017-03-22 16:20:31 -0400
commit71753cdd468fffd3ba6b5ff548084dedf2d137ef (patch)
tree8a16c939fae64465d94cd1294b7e4ecd7d2a660c /public/js/gogs.js
parentd3363430dcfd229df9770cceedbf8d7959263918 (diff)
templates/label: another minor style improve
Diffstat (limited to 'public/js/gogs.js')
-rw-r--r--public/js/gogs.js11
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 &nbsp; 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('&nbsp;');
+ })
$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('&nbsp;');
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('&nbsp;');
});
$list.find('.item').each(function () {