summaryrefslogtreecommitdiff
path: root/app/helpers/issuables_helper.rb
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-07-16 09:32:08 +0100
committerPhil Hughes <me@iamphill.com>2016-07-20 10:48:02 +0100
commit3582861cbcb3e4c80822408c6c31d0de48720813 (patch)
treec9279f21db346ecd2dec801c85bdc79eb0f429d1 /app/helpers/issuables_helper.rb
parentbf1d0cbeaefbbf431bc6c5042e7406c9842b5226 (diff)
downloadgitlab-ce-3582861cbcb3e4c80822408c6c31d0de48720813.tar.gz
Fixed label dropdown bugs with pre-selecting the toggle label
Diffstat (limited to 'app/helpers/issuables_helper.rb')
-rw-r--r--app/helpers/issuables_helper.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/helpers/issuables_helper.rb b/app/helpers/issuables_helper.rb
index a3a8c7d5ff9..114cf804d6f 100644
--- a/app/helpers/issuables_helper.rb
+++ b/app/helpers/issuables_helper.rb
@@ -10,10 +10,11 @@ module IssuablesHelper
def multi_label_name(current_labels, default_label)
# current_labels may be a string from before
if current_labels.is_a?(Array) && current_labels.any?
+ title = current_labels[0].try(:title) || current_labels[0]
if current_labels.count > 1
- "#{current_labels[0]} +#{current_labels.count - 1} more"
+ "#{title} +#{current_labels.count - 1} more"
else
- current_labels[0]
+ title
end
elsif current_labels.is_a?(String)
if current_labels.nil? || current_labels.empty?