Commit b2e673e5 authored by Phil Hughes's avatar Phil Hughes

Removed global JS var

parent 38ea9c6c
......@@ -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()
- 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};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment