Commit 38ea9c6c authored by Phil Hughes's avatar Phil Hughes

Reused some variables

Set global JS variable to sync view up
parent 021d79e3
...@@ -91,7 +91,7 @@ class @Issue ...@@ -91,7 +91,7 @@ class @Issue
# hide any participants from number 6 # hide any participants from number 6
$(".js-participants-author").each (i) -> $(".js-participants-author").each (i) ->
if i > 6 if i >= PARTICIPANTS_ROW
$(@) $(@)
.addClass "js-participants-hidden hidden" .addClass "js-participants-hidden hidden"
...@@ -101,7 +101,7 @@ class @Issue ...@@ -101,7 +101,7 @@ class @Issue
currentText = $(this).text().trim() currentText = $(this).text().trim()
lessText = $(this).data("less-text") lessText = $(this).data("less-text")
originalText = $(this).data("original-text") originalText = $(this).data("original-text")
if currentText is originalText if currentText is originalText
$(this).text(lessText) $(this).text(lessText)
else else
......
- participants_row = 7
- participants_size = participants.size - participants_size = participants.size
- participants_extra = participants_size - 7 - 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')
...@@ -14,4 +17,4 @@ ...@@ -14,4 +17,4 @@
- if participants_extra > 0 - if participants_extra > 0
%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_size - 7} more + #{participants_extra} more
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