Fix annoucement preview image bug
This commit is contained in:
1 parent
2d0fd1d2e4
commit
ff6eb5d674
2 files changed
+73
-84
No files matched your search
@@ -13,13 +13,21 @@
|
||||
<div>
|
||||
<script type="text/javascript" src="/assets/kernel.js"></script>
|
||||
<script type="text/javascript">
|
||||
var preview_img;
|
||||
|
||||
$(function() {
|
||||
$("iframe").load(function() {
|
||||
// Get the body element
|
||||
var frameBody = $("iframe").contents().find('body');
|
||||
// Get all links inside the BODY tag
|
||||
$("iframe").contents().find('#orbit-bar').hide();
|
||||
|
||||
$('.thumbnail').each(function(){
|
||||
if($(this).children('img').length) preview_img = $(this).children('img').attr('src');
|
||||
});
|
||||
|
||||
InsertPreviewImage();
|
||||
|
||||
frameBody.find('a').click(function(e){
|
||||
//Disable all default actions
|
||||
e.preventDefault();
|
||||
@@ -30,6 +38,14 @@
|
||||
$("#show_preview").remove();
|
||||
});
|
||||
});
|
||||
|
||||
function InsertPreviewImage(){
|
||||
if($("iframe").contents().find('.news_image').length){
|
||||
$("iframe").contents().find('.news_image').append("<a href='' target='_blank'><img src='"+preview_img+"' width='320' height='240' /></a>");
|
||||
}else{
|
||||
setTimeout(InsertPreviewImage,1000);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
Reference in new issue
Block a user