Fix image expanding.

This commit is contained in:
Nicolas Stepien 2013-01-22 20:19:18 +01:00
parent 8edd4d5e64
commit fa5f51f1df
3 changed files with 6 additions and 4 deletions

View File

@ -5139,7 +5139,7 @@
} }
thumb.hidden = true; thumb.hidden = true;
$.addClass(thumb.parentNode.parentNode.parentNode, 'image_expanded'); $.addClass(thumb.parentNode.parentNode.parentNode, 'image_expanded');
if (img = thumb.nextSibling) { if ((img = thumb.nextSibling) && img.nodeName === 'IMG') {
img.hidden = false; img.hidden = false;
return; return;
} }
@ -5147,7 +5147,7 @@
src: src src: src
}); });
$.on(img, 'error', ImageExpand.error); $.on(img, 'error', ImageExpand.error);
return $.add(a, img); return $.after(thumb, img);
}, },
error: function() { error: function() {
var src, thumb, timeoutID, url; var src, thumb, timeoutID, url;

View File

@ -1,4 +1,6 @@
master master
- Mayhem
Fix image expanding.
2.37.5 2.37.5
- Mayhem - Mayhem

View File

@ -4152,13 +4152,13 @@ ImageExpand =
return if /\.pdf$/.test src return if /\.pdf$/.test src
thumb.hidden = true thumb.hidden = true
$.addClass thumb.parentNode.parentNode.parentNode, 'image_expanded' $.addClass thumb.parentNode.parentNode.parentNode, 'image_expanded'
if img = thumb.nextSibling if (img = thumb.nextSibling) && img.nodeName is 'IMG'
# Expand already loaded picture # Expand already loaded picture
img.hidden = false img.hidden = false
return return
img = $.el 'img', { src } img = $.el 'img', { src }
$.on img, 'error', ImageExpand.error $.on img, 'error', ImageExpand.error
$.add a, img $.after thumb, img
error: -> error: ->
thumb = @previousSibling thumb = @previousSibling