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

View File

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

View File

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