summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-03-15 11:10:42 +0000
committerPhil Hughes <me@iamphill.com>2016-03-18 09:46:20 +0000
commitb2e673e523ec0e6ff3d2c27d113e9d6a74a80d7a (patch)
treefb567414aa4767902de6124ee6d9550755a44ac5
parent38ea9c6cf7c7c063f841ebe95477e9f48d7bc430 (diff)
downloadgitlab-ce-improved-issue-sidebar.tar.gz
Removed global JS varimproved-issue-sidebar
-rw-r--r--app/assets/javascripts/issue.js.coffee9
-rw-r--r--app/views/shared/issuable/_participants.html.haml4
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};