Gallery: Show thumbnails after document is ready
This commit is contained in:
parent
798e6aa40b
commit
2062ebacef
|
@ -86,18 +86,16 @@ function albumClickHandler(r) {
|
||||||
Albums.recursive = false;
|
Albums.recursive = false;
|
||||||
Albums.token = '';
|
Albums.token = '';
|
||||||
}
|
}
|
||||||
var targetDiv = document.getElementById('gallery_list');
|
$(document).ready(function(){
|
||||||
if (targetDiv) {
|
var targetDiv = $('#gallery_list');
|
||||||
$(targetDiv).html('');
|
targetDiv.html('');
|
||||||
Albums.display(targetDiv);
|
Albums.display(targetDiv);
|
||||||
//$('#gallery_list').sortable({revert:true});
|
//$('#gallery_list').sortable({revert:true});
|
||||||
$('.album').each(function(i, el) {
|
$('.album').each(function(i, el) {
|
||||||
$(el).click(albumClick.bind(null,$(el).attr('title')));
|
$(el).click(albumClick.bind(null,$(el).attr('title')));
|
||||||
//$(el).draggable({connectToSortable: '#gallery_list', handle: '.dummy'});
|
//$(el).draggable({connectToSortable: '#gallery_list', handle: '.dummy'});
|
||||||
});
|
});
|
||||||
} else {
|
});
|
||||||
OC.dialogs.alert(t('gallery', 'Error: no such layer `gallery_list`'), t('gallery', 'Internal error'));
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
OC.dialogs.alert(t('gallery', 'Error: ') + r.cause, t('gallery', 'Internal error'));
|
OC.dialogs.alert(t('gallery', 'Error: ') + r.cause, t('gallery', 'Internal error'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,11 +77,11 @@ Albums={
|
||||||
if (x < 0 || isNaN(x)) x=0;
|
if (x < 0 || isNaN(x)) x=0;
|
||||||
$(this).css('background-position', -x+'px 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>';
|
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) {
|
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({
|
$("a[rel=images]").fancybox({
|
||||||
'titlePosition': 'inside'
|
'titlePosition': 'inside'
|
||||||
|
|
Loading…
Reference in New Issue