accurator/commit
Changed the loading of thumbnails. Again.
author | Chris Dijkshoorn |
---|---|
Thu Apr 21 21:55:36 2016 +0200 | |
committer | Chris Dijkshoorn |
Thu Apr 21 21:55:36 2016 +0200 | |
commit | 69c02eafb7d35ca538215201fd5c55917190b6a1 |
tree | b10973f59029eb674589f50f8457852fe9dc192c |
parent | ec8018fd7857c074944ff1ac2f5ca531147a1322 |
Diff style: patch stat
diff --git a/web/js/components/cluster.js b/web/js/components/cluster.js index e195acd..52f8190 100644 --- a/web/js/components/cluster.js +++ b/web/js/components/cluster.js @@ -113,7 +113,6 @@ Cluster.prototype.addThumbnails = function(numberDisplayedItems) { this.items[i].link, numberDisplayedItems ); - thumbnail.hide(); // hide until image is loaded thumbnail.setClickEvent(this.items[i].link, this.uris, this.path.path); this.thumbnails[i] = thumbnail; } diff --git a/web/js/components/thumbnail.js b/web/js/components/thumbnail.js index e6f5e06..a23ebf9 100644 --- a/web/js/components/thumbnail.js +++ b/web/js/components/thumbnail.js @@ -23,15 +23,13 @@ Thumbnail.prototype.init = function() { 'id':this.id }, $.el.img({ - 'src':'', + 'src':this.thumb, 'class':'img-responsive', 'alt':'' }), $.el.div({'class':'caption'}, this.thumbnailTitle() ))); - - this.setImage(this.thumb); } // Retrieves the item id from the uri string @@ -46,11 +44,6 @@ Thumbnail.prototype.setImage = function(url) { var _thumb = this; $(this.node).find("img").attr("src", url); - // wait for the image to load, then show thumb - $(this.node).find("img").on('load', function() { - _thumb.show(); - }); - // replace image url this.thumb = url; }