From ef886aea7fc4709656ac48236d8c2d71a5039f54 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Fri, 4 Apr 2014 20:50:30 -0700 Subject: [PATCH] Merge fail. --- builds/appchan-x.user.js | 9 +++++---- builds/crx/script.js | 9 +++++---- src/Images/ImageExpand.coffee | 8 ++++---- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index f09ba57be..a049a409e 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -10762,7 +10762,8 @@ $.addClass(thumb, 'expanding'); if (post.file.fullImage) { $.asap((function() { - return post.file.isVideo || post.file.fullImage.naturalHeight; + var file; + return (file = post.file.fullImage) && (file.videoHeight || file.naturalHeight); }), function() { return ImageExpand.completeExpand(post); }); @@ -10779,11 +10780,11 @@ } $.on(file, 'error', ImageExpand.error); $.asap((function() { - return post.file.isVideo || post.file.fullImage.naturalHeight; + return (file = post.file.fullImage) && (file.videoHeight || file.naturalHeight); }), function() { if (isVideo) { - img.style.maxHeight = img[naturalHeight] + "px"; - img.style.maxWidth = img['videoWidth'] + "px"; + file.style.maxHeight = file.videoHeight + "px"; + file.style.maxWidth = file.videoWidth + "px"; } return ImageExpand.completeExpand(post); }); diff --git a/builds/crx/script.js b/builds/crx/script.js index 4ca2661a5..0f0f5ea6b 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -10800,7 +10800,8 @@ $.addClass(thumb, 'expanding'); if (post.file.fullImage) { $.asap((function() { - return post.file.isVideo || post.file.fullImage.naturalHeight; + var file; + return (file = post.file.fullImage) && (file.videoHeight || file.naturalHeight); }), function() { return ImageExpand.completeExpand(post); }); @@ -10817,11 +10818,11 @@ } $.on(file, 'error', ImageExpand.error); $.asap((function() { - return post.file.isVideo || post.file.fullImage.naturalHeight; + return (file = post.file.fullImage) && (file.videoHeight || file.naturalHeight); }), function() { if (isVideo) { - img.style.maxHeight = img[naturalHeight] + "px"; - img.style.maxWidth = img['videoWidth'] + "px"; + file.style.maxHeight = file.videoHeight + "px"; + file.style.maxWidth = file.videoWidth + "px"; } return ImageExpand.completeExpand(post); }); diff --git a/src/Images/ImageExpand.coffee b/src/Images/ImageExpand.coffee index 6ba42a290..68798a7f4 100644 --- a/src/Images/ImageExpand.coffee +++ b/src/Images/ImageExpand.coffee @@ -104,7 +104,7 @@ ImageExpand = $.addClass thumb, 'expanding' if post.file.fullImage # Expand already-loaded/ing picture. - $.asap (-> post.file.isVideo or post.file.fullImage.naturalHeight), -> + $.asap (-> (file = post.file.fullImage) and (file.videoHeight or file.naturalHeight)), -> ImageExpand.completeExpand post return file = @@ -116,11 +116,11 @@ ImageExpand = file.loop = true file.controls = Conf['Show Controls'] $.on file, 'error', ImageExpand.error - $.asap (-> post.file.isVideo or post.file.fullImage.naturalHeight), -> + $.asap (-> (file = post.file.fullImage) and (file.videoHeight or file.naturalHeight)), -> if isVideo # XXX Firefox doesn't seem to size videos correctly? - img.style.maxHeight = img[naturalHeight] + "px" - img.style.maxWidth = img['videoWidth'] + "px" + file.style.maxHeight = file.videoHeight + "px" + file.style.maxWidth = file.videoWidth + "px" ImageExpand.completeExpand post $.after (if file.controls then thumb.parentNode else thumb), file