From 6d29b362003c15334577c596f676a0fb599d7bdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Wed, 25 Jul 2018 14:26:04 +0200 Subject: [PATCH 1/2] Limit small avatar rendering only to inline mentions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- apps/comments/js/commentstabview.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/comments/js/commentstabview.js b/apps/comments/js/commentstabview.js index c3903674e8..db38d055af 100644 --- a/apps/comments/js/commentstabview.js +++ b/apps/comments/js/commentstabview.js @@ -386,7 +386,11 @@ _postRenderItem: function($el, editionMode) { $el.find('.has-tooltip').tooltip(); - $el.find('.avatar').each(function () { + var inlineAvatars = $el.find('.message .avatar'); + if ($($el.context).hasClass('message')) { + inlineAvatars = $el.find('.avatar'); + } + inlineAvatars.each(function () { var $this = $(this); $this.avatar($this.attr('data-username'), 16); }); From 1f635bb8928ad7ca7c5f851595bf9936cd0f5951 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Wed, 25 Jul 2018 14:26:27 +0200 Subject: [PATCH 2/2] Use small loading indicator for avatars smaller than 32px MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- core/js/jquery.avatar.js | 6 +++++- core/js/placeholder.js | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/core/js/jquery.avatar.js b/core/js/jquery.avatar.js index 6da86341c1..7384804c9d 100644 --- a/core/js/jquery.avatar.js +++ b/core/js/jquery.avatar.js @@ -133,7 +133,11 @@ } }; - $div.addClass('icon-loading'); + if (size < 32) { + $div.addClass('icon-loading-small'); + } else { + $div.addClass('icon-loading'); + } img.width = size; img.height = size; img.src = url; diff --git a/core/js/placeholder.js b/core/js/placeholder.js index 81f0b12e61..7c1bd72455 100644 --- a/core/js/placeholder.js +++ b/core/js/placeholder.js @@ -169,5 +169,6 @@ this.css('font-size', ''); this.html(''); this.removeClass('icon-loading'); + this.removeClass('icon-loading-small'); }; }(jQuery));