diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-05-09 22:58:43 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-05-10 09:04:10 +0200 |
commit | 2062ebacefea154e1ac7cbff69ac9b38c0b37f55 (patch) | |
tree | b8c614b67983822dc0ff80e601c73286df35f49e /apps/gallery | |
parent | 798e6aa40baa518945dd395498c7603790776193 (diff) | |
download | nextcloud-server-2062ebacefea154e1ac7cbff69ac9b38c0b37f55.tar.gz nextcloud-server-2062ebacefea154e1ac7cbff69ac9b38c0b37f55.zip |
Gallery: Show thumbnails after document is ready
Diffstat (limited to 'apps/gallery')
-rw-r--r-- | apps/gallery/js/album_cover.js | 10 | ||||
-rw-r--r-- | apps/gallery/js/albums.js | 4 |
2 files changed, 6 insertions, 8 deletions
diff --git a/apps/gallery/js/album_cover.js b/apps/gallery/js/album_cover.js index 61084c99b29..d1809462f2f 100644 --- a/apps/gallery/js/album_cover.js +++ b/apps/gallery/js/album_cover.js @@ -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')); } diff --git a/apps/gallery/js/albums.js b/apps/gallery/js/albums.js index 1fb38a5546c..35537aa54c2 100644 --- a/apps/gallery/js/albums.js +++ b/apps/gallery/js/albums.js @@ -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' |