From b193dc0733a8d7a342085c964c1943d877876361 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Fri, 30 Jan 2015 09:30:06 +0000 Subject: [PATCH] Fix expose view loading for the first time always shows loading icon --- etemplate/js/expose.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/etemplate/js/expose.js b/etemplate/js/expose.js index 126be9b66a..4e386e3086 100644 --- a/etemplate/js/expose.js +++ b/etemplate/js/expose.js @@ -134,9 +134,11 @@ function expose (widget) // Don't bother with adding a default, we just did that if(image.loading) { - $j(gallery.slides[index]) - .addClass(gallery.options.slideLoadingClass) - .removeClass(gallery.options.slideErrorClass); + //Add load class if it's really a slide with error + if (gallery.slidesContainer.find('[data-index="'+index+'"]').hasClass(gallery.options.slideErrorClass)) + $j(gallery.slides[index]) + .addClass(gallery.options.slideLoadingClass) + .removeClass(gallery.options.slideErrorClass); return; }