Browse Source

fix options image preview showing

master
Simon Grim 9 years ago
parent
commit
045836a020
  1. 8
      js/options.js
  2. 4
      js/twister_formatpost.js

8
js/options.js

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

4
js/twister_formatpost.js

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

Loading…
Cancel
Save