Fix: Issues cannot be created with labels (#622)

Signed-off-by: Kazuki Sawada <kazuki@6715.jp>
tokarchuk/v1.17
Kazuki Sawada 8 years ago committed by Lunny Xiao
parent 742f2c0301
commit e5620f07a4
  1. 6
      public/js/index.js

@ -123,10 +123,10 @@ function initCommentForm() {
} }
} }
var labelIds = ""; var labelIds = [];
$(this).parent().find('.item').each(function () { $(this).parent().find('.item').each(function () {
if ($(this).hasClass('checked')) { if ($(this).hasClass('checked')) {
labelIds += $(this).data('id') + ","; labelIds.push($(this).data('id'));
$($(this).data('id-selector')).removeClass('hide'); $($(this).data('id-selector')).removeClass('hide');
} else { } else {
$($(this).data('id-selector')).addClass('hide'); $($(this).data('id-selector')).addClass('hide');
@ -137,7 +137,7 @@ function initCommentForm() {
} else { } else {
$noSelect.addClass('hide'); $noSelect.addClass('hide');
} }
$($(this).parent().data('id')).val(labelIds); $($(this).parent().data('id')).val(labelIds.join(","));
return false; return false;
}); });
$labelMenu.find('.no-select.item').click(function () { $labelMenu.find('.no-select.item').click(function () {

Loading…
Cancel
Save