diff options
-rw-r--r-- | app/assets/javascripts/issue.js.coffee | 9 | ||||
-rw-r--r-- | app/views/shared/issuable/_participants.html.haml | 4 |
2 files changed, 7 insertions, 6 deletions
diff --git a/app/assets/javascripts/issue.js.coffee b/app/assets/javascripts/issue.js.coffee index 424c354b755..f50df1f5ea3 100644 --- a/app/assets/javascripts/issue.js.coffee +++ b/app/assets/javascripts/issue.js.coffee @@ -87,13 +87,14 @@ class @Issue data: patchData initParticipants: -> + _this = @ $(document).on "click", ".js-participants-more", @toggleHiddenParticipants - # hide any participants from number 6 $(".js-participants-author").each (i) -> - if i >= PARTICIPANTS_ROW + if i >= _this.PARTICIPANTS_ROW_COUNT $(@) - .addClass "js-participants-hidden hidden" + .addClass "js-participants-hidden" + .hide() toggleHiddenParticipants: (e) -> e.preventDefault() @@ -107,4 +108,4 @@ class @Issue else $(this).text(originalText) - $(".js-participants-hidden").toggleClass "hidden" + $(".js-participants-hidden").toggle() diff --git a/app/views/shared/issuable/_participants.html.haml b/app/views/shared/issuable/_participants.html.haml index 75a330c9e5f..3fb409ff727 100644 --- a/app/views/shared/issuable/_participants.html.haml +++ b/app/views/shared/issuable/_participants.html.haml @@ -1,8 +1,6 @@ - participants_row = 7 - participants_size = participants.size - participants_extra = participants_size - participants_row -:javascript - var PARTICIPANTS_ROW = #{participants_row}; .block.participants .sidebar-collapsed-icon = icon('users') @@ -18,3 +16,5 @@ %div.participants-more %a.js-participants-more{href: "#", data: {original_text: "+ #{participants_size - 7} more", less_text: "- show less"}} + #{participants_extra} more +:javascript + Issue.prototype.PARTICIPANTS_ROW_COUNT = #{participants_row}; |