Commit d2848f9d authored by Filipa Lacerda's avatar Filipa Lacerda

Fix CSS in load more participants

parent 3f9022cf
...@@ -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{ data: { original_text: "+ #{participants_size - 7} more", less_text: "- show less", type: 'button' } }
+ #{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