I think I'm satisfied with this now.
This commit is contained in:
parent
5507168019
commit
9159f7adbc
@ -6283,7 +6283,7 @@
|
||||
}
|
||||
},
|
||||
toggle: function(post) {
|
||||
var headRect, next, rect, root, thumb, x, y;
|
||||
var headRect, rect, root, thumb, x, y;
|
||||
|
||||
thumb = post.file.thumb;
|
||||
if (!(post.file.isExpanded || $.hasClass(thumb, 'expanding'))) {
|
||||
@ -6292,14 +6292,18 @@
|
||||
}
|
||||
ImageExpand.contract(post);
|
||||
root = post.nodes.root;
|
||||
if (Conf['Advance on contract']) {
|
||||
while (next = $.x("following::div[contains(@class,'postContainer')][1]", root)) {
|
||||
if (!($('.stub', next) || next.offsetHeight === 0)) {
|
||||
break;
|
||||
rect = (Conf['Advance on contract'] ? (function() {
|
||||
var next;
|
||||
|
||||
next = root;
|
||||
while (next = $.x("following::div[contains(@class,'postContainer')][1]", next)) {
|
||||
if ($('.stub', next) || next.offsetHeight === 0) {
|
||||
continue;
|
||||
}
|
||||
return next;
|
||||
}
|
||||
}
|
||||
rect = (next || root).getBoundingClientRect();
|
||||
return root;
|
||||
})() : root).getBoundingClientRect();
|
||||
if (rect.top < 0) {
|
||||
y = rect.top;
|
||||
if (Conf['Fixed Header'] && !Conf['Bottom Header']) {
|
||||
|
||||
@ -6263,7 +6263,7 @@
|
||||
}
|
||||
},
|
||||
toggle: function(post) {
|
||||
var headRect, next, rect, root, thumb, x, y;
|
||||
var headRect, rect, root, thumb, x, y;
|
||||
|
||||
thumb = post.file.thumb;
|
||||
if (!(post.file.isExpanded || $.hasClass(thumb, 'expanding'))) {
|
||||
@ -6272,14 +6272,18 @@
|
||||
}
|
||||
ImageExpand.contract(post);
|
||||
root = post.nodes.root;
|
||||
if (Conf['Advance on contract']) {
|
||||
while (next = $.x("following::div[contains(@class,'postContainer')][1]", root)) {
|
||||
if (!($('.stub', next) || next.offsetHeight === 0)) {
|
||||
break;
|
||||
rect = (Conf['Advance on contract'] ? (function() {
|
||||
var next;
|
||||
|
||||
next = root;
|
||||
while (next = $.x("following::div[contains(@class,'postContainer')][1]", next)) {
|
||||
if ($('.stub', next) || next.offsetHeight === 0) {
|
||||
continue;
|
||||
}
|
||||
return next;
|
||||
}
|
||||
}
|
||||
rect = (next || root).getBoundingClientRect();
|
||||
return root;
|
||||
})() : root).getBoundingClientRect();
|
||||
if (rect.top < 0) {
|
||||
y = rect.top;
|
||||
if (Conf['Fixed Header'] && !Conf['Bottom Header']) {
|
||||
|
||||
@ -62,11 +62,15 @@ ImageExpand =
|
||||
# Scroll back to the thumbnail when contracting the image
|
||||
# to avoid being left miles away from the relevant post.
|
||||
{root} = post.nodes
|
||||
if Conf['Advance on contract']
|
||||
while next = $.x "following::div[contains(@class,'postContainer')][1]", root
|
||||
break unless $('.stub', next) or next.offsetHeight is 0
|
||||
|
||||
rect = (next or root).getBoundingClientRect()
|
||||
rect = (if Conf['Advance on contract'] then do ->
|
||||
next = root
|
||||
while next = $.x "following::div[contains(@class,'postContainer')][1]", next
|
||||
continue if $('.stub', next) or next.offsetHeight is 0
|
||||
return next
|
||||
root
|
||||
else
|
||||
root
|
||||
).getBoundingClientRect()
|
||||
|
||||
if rect.top < 0
|
||||
y = rect.top
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user