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() { @@ -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();
}

4
js/twister_formatpost.js

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

Loading…
Cancel
Save