Commit b2e673e5 authored by Phil Hughes's avatar Phil Hughes

Removed global JS var

parent 38ea9c6c
...@@ -87,13 +87,14 @@ class @Issue ...@@ -87,13 +87,14 @@ class @Issue
data: patchData data: patchData
initParticipants: -> initParticipants: ->
_this = @
$(document).on "click", ".js-participants-more", @toggleHiddenParticipants $(document).on "click", ".js-participants-more", @toggleHiddenParticipants
# hide any participants from number 6
$(".js-participants-author").each (i) -> $(".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) -> toggleHiddenParticipants: (e) ->
e.preventDefault() e.preventDefault()
...@@ -107,4 +108,4 @@ class @Issue ...@@ -107,4 +108,4 @@ class @Issue
else else
$(this).text(originalText) $(this).text(originalText)
$(".js-participants-hidden").toggleClass "hidden" $(".js-participants-hidden").toggle()
- participants_row = 7 - participants_row = 7
- participants_size = participants.size - participants_size = participants.size
- participants_extra = participants_size - participants_row - participants_extra = participants_size - participants_row
:javascript
var PARTICIPANTS_ROW = #{participants_row};
.block.participants .block.participants
.sidebar-collapsed-icon .sidebar-collapsed-icon
= icon('users') = icon('users')
...@@ -18,3 +16,5 @@ ...@@ -18,3 +16,5 @@
%div.participants-more %div.participants-more
%a.js-participants-more{href: "#", data: {original_text: "+ #{participants_size - 7} more", less_text: "- show less"}} %a.js-participants-more{href: "#", data: {original_text: "+ #{participants_size - 7} more", less_text: "- show less"}}
+ #{participants_extra} more + #{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