From a118817a69e123b74a48b0c85df15da3487ff070 Mon Sep 17 00:00:00 2001 From: "John Molakvoæ (skjnldsv)" Date: Thu, 14 Dec 2017 08:29:22 +0100 Subject: Add loading icon on avatar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- core/js/jquery.avatar.js | 3 ++- core/js/placeholder.js | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'core') diff --git a/core/js/jquery.avatar.js b/core/js/jquery.avatar.js index b44fe5fd631..0d4c063a91a 100644 --- a/core/js/jquery.avatar.js +++ b/core/js/jquery.avatar.js @@ -140,12 +140,13 @@ // If the new image loads successfully set it. img.onload = function() { - $div.show(); $div.text(''); $div.append(img); $div.clearimageplaceholder(); }; + $div.addClass('icon-loading'); + $div.show(); img.width = size; img.height = size; img.src = url; diff --git a/core/js/placeholder.js b/core/js/placeholder.js index f173e738676..5cf7b9095ad 100644 --- a/core/js/placeholder.js +++ b/core/js/placeholder.js @@ -2,7 +2,7 @@ * ownCloud * * @author John Molakvoæ - * @copyright 2016 John Molakvoæ + * @copyright 2016-2017 John Molakvoæ * @author Morris Jobke * @copyright 2013 Morris Jobke * @@ -47,7 +47,7 @@ *
A
* */ - + /* * Alternatively, you can use the prototype function to convert your string to hsl colors: * @@ -156,5 +156,6 @@ this.css('text-align', ''); this.css('line-height', ''); this.css('font-size', ''); + this.removeClass('icon-loading'); }; }(jQuery)); -- cgit v1.2.3