# HG changeset patch # User neko259 # Date 2015-09-30 15:12:32 # Node ID 60237ae8beb53a397f642bdfbe941d6f92fd7d32 # Parent 21f71300117daa4f5ff5653344d10990d057276b Don't jquery-select image's post twice diff --git a/boards/static/js/image.js b/boards/static/js/image.js --- a/boards/static/js/image.js +++ b/boards/static/js/image.js @@ -73,7 +73,7 @@ PopupImageViewer.prototype.view = functi var thumb_id = 'full' + el.find('img').attr('alt'); var existingPopups = $('#' + thumb_id); - if(!existingPopups.length) { + if (!existingPopups.length) { var imgElement= el.find('img'); var img_w = imgElement.attr('data-width'); @@ -98,12 +98,14 @@ PopupImageViewer.prototype.view = functi img_w = img_w / scale; img_h = img_h / scale; + var postNode = $(el); + var img_pv = new Image(); var newImage = $(img_pv); newImage.addClass('img-full') .attr('id', thumb_id) - .attr('src', $(el).attr('href')) - .appendTo($(el)) + .attr('src', postNode.attr('href')) + .appendTo(postNode) .css({ 'width': img_w, 'height': img_h,