summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-10-23 16:12:31 +0000
committerPhil Hughes <me@iamphill.com>2017-10-23 16:12:31 +0000
commitf94c391752941f2793f348a587760aa159e011c0 (patch)
treea521fdadc330e10b4af7fcbb3fd0abfcf4899b00
parentd5e2f873db06f6505ceac0936bdf50f5e312f70b (diff)
parent464b075d530f453652d9fbae9d33d4e06b22a0bd (diff)
downloadgitlab-ce-f94c391752941f2793f348a587760aa159e011c0.tar.gz
Merge branch '39299-sidebar-links' into 'master'
Fix CSS in load more participants Closes #39299 See merge request gitlab-org/gitlab-ce!15005
-rw-r--r--app/assets/javascripts/issuable_context.js19
-rw-r--r--app/views/shared/issuable/_participants.html.haml2
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..3f553c9fede 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{ type: 'button', data: { original_text: "+ #{participants_size - 7} more", less_text: "- show less" } }
+ #{participants_extra} more