diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2017-10-23 15:45:09 +0300 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2017-10-23 15:47:50 +0300 |
commit | d2848f9da6e0b06376ca2ed0297cdca551130aca (patch) | |
tree | 5545b5d3cf955580d0cbdad3f6839da82a450ed1 /app | |
parent | 3f9022cf78a6e8fce1781d53e86e4955bd88c3c6 (diff) |
Fix CSS in load more participants
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/issuable_context.js | 19 | ||||
-rw-r--r-- | app/views/shared/issuable/_participants.html.haml | 2 |
2 files changed, 10 insertions, 11 deletions
diff --git a/app/assets/javascripts/issuable_context.js b/app/assets/javascripts/issuable_context.js index 1d305f1eb2f..73791edaebb 100644 --- a/app/assets/javascripts/issuable_context.js +++ b/app/assets/javascripts/issuable_context.js @@ -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; diff --git a/app/views/shared/issuable/_participants.html.haml b/app/views/shared/issuable/_participants.html.haml index d2b62557e03..9038633280a 100644 --- a/app/views/shared/issuable/_participants.html.haml +++ b/app/views/shared/issuable/_participants.html.haml @@ -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{ data: { original_text: "+ #{participants_size - 7} more", less_text: "- show less", type: 'button' } } + #{participants_extra} more |