summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/assets/javascripts/issue.js.coffee4
-rw-r--r--app/views/shared/issuable/_participants.html.haml7
2 files changed, 7 insertions, 4 deletions
diff --git a/app/assets/javascripts/issue.js.coffee b/app/assets/javascripts/issue.js.coffee
index 47db7c63ec6..424c354b755 100644
--- a/app/assets/javascripts/issue.js.coffee
+++ b/app/assets/javascripts/issue.js.coffee
@@ -91,7 +91,7 @@ class @Issue
# hide any participants from number 6
$(".js-participants-author").each (i) ->
- if i > 6
+ if i >= PARTICIPANTS_ROW
$(@)
.addClass "js-participants-hidden hidden"
@@ -101,7 +101,7 @@ class @Issue
currentText = $(this).text().trim()
lessText = $(this).data("less-text")
originalText = $(this).data("original-text")
-
+
if currentText is originalText
$(this).text(lessText)
else
diff --git a/app/views/shared/issuable/_participants.html.haml b/app/views/shared/issuable/_participants.html.haml
index 8fe1c9af118..75a330c9e5f 100644
--- a/app/views/shared/issuable/_participants.html.haml
+++ b/app/views/shared/issuable/_participants.html.haml
@@ -1,5 +1,8 @@
+- participants_row = 7
- participants_size = participants.size
-- participants_extra = participants_size - 7
+- participants_extra = participants_size - participants_row
+:javascript
+ var PARTICIPANTS_ROW = #{participants_row};
.block.participants
.sidebar-collapsed-icon
= icon('users')
@@ -14,4 +17,4 @@
- if participants_extra > 0
%div.participants-more
%a.js-participants-more{href: "#", data: {original_text: "+ #{participants_size - 7} more", less_text: "- show less"}}
- + #{participants_size - 7} more
+ + #{participants_extra} more