fix options image preview showing

This commit is contained in:
Simon Grim 2015-08-18 19:08:26 +05:00
parent 29b82d260c
commit 045836a020
2 changed files with 5 additions and 7 deletions

View File

@ -377,13 +377,7 @@ function tickOptionsPostPreview() {
if ($.Options.displayPreview.val === 'enable') {
imgPreviewCont.empty();
var links = elem.children().first().find('a[rel="nofollow"]');
if (links.length) {
setPostImagePreview(elem, links);
imgPreviewCont.show();
} else {
imgPreviewCont.hide();
}
setPostImagePreview(elem, elem.children().first().find('a'));
} else {
imgPreviewCont.hide();
}

View File

@ -807,5 +807,9 @@ function setPostImagePreview(elem, links) {
}
}
}
if (previewContainer.children().length)
previewContainer.show();
else
previewContainer.hide();
}
}