diff options
Diffstat (limited to 'apps/gallery/js/album_cover.js')
-rw-r--r-- | apps/gallery/js/album_cover.js | 10 |
1 files changed, 4 insertions, 6 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')); } |