Fixed showing preview link for non-images in upload

This commit is contained in:
Marcin Kurczewski 2015-03-21 08:17:58 +01:00
parent aa228d5125
commit 06180f5b50

View file

@ -331,13 +331,16 @@ App.Presenters.PostUploadPresenter = function(
post.getThumbnail(null, null).then(function(thumbnailDataURL) {
var $thumbnail = $el.find('.form-slider .thumbnail');
var $img = $thumbnail.find('img');
var $link = $thumbnail.find('a');
if (thumbnailDataURL === null) {
$img.hide();
$link.hide();
} else {
$img.show();
$img.attr('src', thumbnailDataURL);
$link.show();
$link.attr('href', thumbnailDataURL);
}
$el.find('.form-slider .thumbnail a').attr('href', thumbnailDataURL);
});
}