templates/label: another minor style improve

This commit is contained in:
Unknwon
2017-03-22 16:20:31 -04:00
parent d3363430dc
commit 71753cdd46
6 changed files with 14 additions and 7 deletions

View File

@@ -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('&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 () {