Small simplify

This commit is contained in:
Zixaphir 2013-08-06 13:37:24 -07:00
parent 7939d24640
commit 1227cbd847
3 changed files with 6 additions and 16 deletions

View File

@ -6292,12 +6292,7 @@
} }
ImageExpand.contract(post); ImageExpand.contract(post);
root = post.nodes.root; root = post.nodes.root;
rect = (Conf['Advance on contract'] ? (function() { rect = (Conf['Advance on contract'] ? $.x("following::div[contains(@class,'postContainer')][1]", root) || root : root).getBoundingClientRect();
var next;
next = $.x("following::div[contains(@class,'postContainer')][1]", root);
return next || root;
})() : root).getBoundingClientRect();
if (rect.top < 0) { if (rect.top < 0) {
y = rect.top; y = rect.top;
if (Conf['Fixed Header'] && !Conf['Bottom Header']) { if (Conf['Fixed Header'] && !Conf['Bottom Header']) {

View File

@ -6272,12 +6272,7 @@
} }
ImageExpand.contract(post); ImageExpand.contract(post);
root = post.nodes.root; root = post.nodes.root;
rect = (Conf['Advance on contract'] ? (function() { rect = (Conf['Advance on contract'] ? $.x("following::div[contains(@class,'postContainer')][1]", root) || root : root).getBoundingClientRect();
var next;
next = $.x("following::div[contains(@class,'postContainer')][1]", root);
return next || root;
})() : root).getBoundingClientRect();
if (rect.top < 0) { if (rect.top < 0) {
y = rect.top; y = rect.top;
if (Conf['Fixed Header'] && !Conf['Bottom Header']) { if (Conf['Fixed Header'] && !Conf['Bottom Header']) {

View File

@ -62,11 +62,11 @@ ImageExpand =
# Scroll back to the thumbnail when contracting the image # Scroll back to the thumbnail when contracting the image
# to avoid being left miles away from the relevant post. # to avoid being left miles away from the relevant post.
{root} = post.nodes {root} = post.nodes
rect = (if Conf['Advance on contract'] then do -> rect = (if Conf['Advance on contract']
next = $.x "following::div[contains(@class,'postContainer')][1]", root $.x("following::div[contains(@class,'postContainer')][1]", root) or root
next or root
else else
root).getBoundingClientRect() root
).getBoundingClientRect()
if rect.top < 0 if rect.top < 0
y = rect.top y = rect.top