Commit 4b9a732f authored by fred's avatar fred
Browse files

gallery: empty legend if there's none

parent 70159c2b
......@@ -536,7 +536,7 @@ $(function() {
$(this).parents('.gallerycell').removeClass('portrait');
}
$gallery.find('div.first img').attr('src', $(this).data('image-large'));
$gallery.find('div.first span.gallery-legend').text($(this).find('img').attr('title'));
$gallery.find('div.first span.gallery-legend').text($(this).find('img').attr('title') || '');
$gallery.find('div.first').show('fade');
return false;
});
......@@ -608,7 +608,7 @@ $(function() {
$(new_img).css('transform', 'scale(0, 1)');
$(new_img)[0].offsetHeight; /* trigger reflow */
$(new_img).css('opacity', 1).css('transform', 'scale(1)');
$(new_img).parents('.gallery').find('span.gallery-legend').text($(all_img[idx]).attr('title'));
$(new_img).parents('.gallery').find('span.gallery-legend').text($(all_img[idx]).attr('title') || '');
if ($(all_img[idx]).hasClass('portrait')) {
if (! $(new_img).parents('.gallerycell').hasClass('portrait')) {
$visible_element.parent().find('img:not(:last)').remove();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment