Skip to content
Snippets Groups Projects
Commit 2062ebac authored by Bart Visscher's avatar Bart Visscher
Browse files

Gallery: Show thumbnails after document is ready

parent 798e6aa4
Branches
No related tags found
No related merge requests found
......@@ -86,18 +86,16 @@ function albumClickHandler(r) {
Albums.recursive = false;
Albums.token = '';
}
var targetDiv = document.getElementById('gallery_list');
if (targetDiv) {
$(targetDiv).html('');
$(document).ready(function(){
var targetDiv = $('#gallery_list');
targetDiv.html('');
Albums.display(targetDiv);
//$('#gallery_list').sortable({revert:true});
$('.album').each(function(i, el) {
$(el).click(albumClick.bind(null,$(el).attr('title')));
//$(el).draggable({connectToSortable: '#gallery_list', handle: '.dummy'});
});
} else {
OC.dialogs.alert(t('gallery', 'Error: no such layer `gallery_list`'), t('gallery', 'Internal error'));
}
});
} else {
OC.dialogs.alert(t('gallery', 'Error: ') + r.cause, t('gallery', 'Internal error'));
}
......
......@@ -77,11 +77,11 @@ Albums={
if (x < 0 || isNaN(x)) x=0;
$(this).css('background-position', -x+'px 0');
});
$(element).append(local);
element.append(local);
}
var photoDisplayTemplate = '<div class="gallery_box"><div class="dummy"></div><div><a rel="images" href="'+OC.linkTo('files','download.php')+'?file=URLPATH"><img src="'+OC.filePath('gallery','ajax','thumbnail.php')+'?img=IMGPATH"></a></div></div>';
for (var i in Albums.photos) {
$(element).append(photoDisplayTemplate.replace("IMGPATH", escape(Albums.photos[i])).replace("URLPATH", escape(Albums.photos[i])));
element.append(photoDisplayTemplate.replace("IMGPATH", escape(Albums.photos[i])).replace("URLPATH", escape(Albums.photos[i])));
}
$("a[rel=images]").fancybox({
'titlePosition': 'inside'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment