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] 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));