Commit f94c3917 authored by Phil Hughes's avatar Phil Hughes

Merge branch '39299-sidebar-links' into 'master'

Fix CSS in load more participants

Closes #39299

See merge request gitlab-org/gitlab-ce!15005
parents d5e2f873 464b075d
...@@ -51,20 +51,19 @@ const PARTICIPANTS_ROW_COUNT = 7; ...@@ -51,20 +51,19 @@ const PARTICIPANTS_ROW_COUNT = 7;
} }
IssuableContext.prototype.initParticipants = function() { IssuableContext.prototype.initParticipants = function() {
$(document).on("click", ".js-participants-more", this.toggleHiddenParticipants); $(document).on('click', '.js-participants-more', this.toggleHiddenParticipants);
return $(".js-participants-author").each(function(i) { return $('.js-participants-author').each(function(i) {
if (i >= PARTICIPANTS_ROW_COUNT) { if (i >= PARTICIPANTS_ROW_COUNT) {
return $(this).addClass("js-participants-hidden").hide(); return $(this).addClass('js-participants-hidden').hide();
} }
}); });
}; };
IssuableContext.prototype.toggleHiddenParticipants = function(e) { IssuableContext.prototype.toggleHiddenParticipants = function() {
var currentText, lessText, originalText; const currentText = $(this).text().trim();
e.preventDefault(); const lessText = $(this).data('less-text');
currentText = $(this).text().trim(); const originalText = $(this).data('original-text');
lessText = $(this).data("less-text");
originalText = $(this).data("original-text");
if (currentText === originalText) { if (currentText === originalText) {
$(this).text(lessText); $(this).text(lessText);
...@@ -73,7 +72,7 @@ const PARTICIPANTS_ROW_COUNT = 7; ...@@ -73,7 +72,7 @@ const PARTICIPANTS_ROW_COUNT = 7;
$(this).text(originalText); $(this).text(originalText);
} }
$(".js-participants-hidden").toggle(); $('.js-participants-hidden').toggle();
}; };
return IssuableContext; return IssuableContext;
......
...@@ -14,5 +14,5 @@ ...@@ -14,5 +14,5 @@
= link_to_member(@project, participant, name: false, size: 24, lazy_load: true) = link_to_member(@project, participant, name: false, size: 24, lazy_load: true)
- if participants_extra > 0 - if participants_extra > 0
.hide-collapsed.participants-more .hide-collapsed.participants-more
%a.js-participants-more{ href: "#", data: { original_text: "+ #{participants_size - 7} more", less_text: "- show less" } } %button.btn-transparent.btn-blank.js-participants-more{ type: 'button', data: { original_text: "+ #{participants_size - 7} more", less_text: "- show less" } }
+ #{participants_extra} 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