Skip to content

Commit f0d3ef2

Browse files
authored
Merge pull request #11 from clowder-framework/wrap-empty-collectionsbyspace-in-new-row
Fixed incorrect selector on imagesLoaded in the Space view
2 parents 56e7443 + abd93b3 commit f0d3ef2

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

app/views/datasets/tile.scala.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<div class="panel-body">
1818
@if(!dataset.thumbnail_id.isEmpty){
1919
<a href="@(routes.Datasets.dataset(dataset.id,space))">
20-
<img class="img-responsive fit-in-space" src="@(routes.Files.thumbnail(UUID(dataset.thumbnail_id.toString().substring(5,dataset.thumbnail_id.toString().length-1))))" alt="Thumbnail of @Html(dataset.name)">
20+
<img class="img-responsive fit-in-space tiled-image" src="@(routes.Files.thumbnail(UUID(dataset.thumbnail_id.toString().substring(5,dataset.thumbnail_id.toString().length-1))))" alt="Thumbnail of @Html(dataset.name)">
2121
</a>
2222
}
2323
<div class="caption break-word">

app/views/spaces/space.scala.html

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -128,18 +128,21 @@ <h3>@Messages("collections.title")</h3>
128128
<script>
129129
function activateOne(id) {
130130
// initialize Masonry
131-
var items = $("#" + id);
132-
if(items.length) {
133-
var $container = $("#" + id).masonry();
134-
// layout Masonry again after all images have loaded
135-
imagesLoaded( '#masonry', function() {
136-
$container.masonry({
137-
itemSelector: '.post-box',
138-
columnWidth: '.post-box',
139-
transitionDuration: 4
140-
});
141-
});
131+
var match = $("#" + id);
132+
if (!match) {
133+
return;
142134
}
135+
136+
match.masonry();
137+
138+
// layout Masonry again after all images have loaded
139+
imagesLoaded( '.tiled-image', function() {
140+
match.masonry({
141+
itemSelector: '.tiled-image',
142+
columnWidth: '.tiled-image',
143+
transitionDuration: 4
144+
});
145+
});
143146
}
144147

145148
function activate(){

0 commit comments

Comments
 (0)