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;
}
IssuableContext.prototype.initParticipants = function() {
$(document).on("click", ".js-participants-more", this.toggleHiddenParticipants);
return $(".js-participants-author").each(function(i) {
$(document).on('click', '.js-participants-more', this.toggleHiddenParticipants);
return $('.js-participants-author').each(function(i) {
if (i >= PARTICIPANTS_ROW_COUNT) {
return $(this).addClass("js-participants-hidden").hide();
return $(this).addClass('js-participants-hidden').hide();
}
});
};
IssuableContext.prototype.toggleHiddenParticipants = function(e) {
var currentText, lessText, originalText;
e.preventDefault();
currentText = $(this).text().trim();
lessText = $(this).data("less-text");
originalText = $(this).data("original-text");
IssuableContext.prototype.toggleHiddenParticipants = function() {
const currentText = $(this).text().trim();
const lessText = $(this).data('less-text');
const originalText = $(this).data('original-text');
if (currentText === originalText) {
$(this).text(lessText);
......@@ -73,7 +72,7 @@ const PARTICIPANTS_ROW_COUNT = 7;
$(this).text(originalText);
}
$(".js-participants-hidden").toggle();
$('.js-participants-hidden').toggle();
};
return IssuableContext;
......
......@@ -14,5 +14,5 @@
= link_to_member(@project, participant, name: false, size: 24, lazy_load: true)
- if participants_extra > 0
.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
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