Fix our ImageExpand scrolling.
This commit is contained in:
parent
d7407cfd94
commit
186a7e6a5a
@ -3264,8 +3264,11 @@
|
|||||||
if (!(rect.top <= 0 || rect.left <= 0)) {
|
if (!(rect.top <= 0 || rect.left <= 0)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
headRect = Header.bar.getBoundingClientRect();
|
top = rect.top;
|
||||||
top = rect.top - headRect.top - headRect.height;
|
if (Conf['Fixed Header'] && !Conf['Bottom Header']) {
|
||||||
|
headRect = Header.bar.getBoundingClientRect();
|
||||||
|
top += -headRect.top - headRect.height;
|
||||||
|
}
|
||||||
root = doc;
|
root = doc;
|
||||||
if (rect.top < 0) {
|
if (rect.top < 0) {
|
||||||
root.scrollTop += top;
|
root.scrollTop += top;
|
||||||
|
|||||||
@ -3255,8 +3255,11 @@
|
|||||||
if (!(rect.top <= 0 || rect.left <= 0)) {
|
if (!(rect.top <= 0 || rect.left <= 0)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
headRect = Header.bar.getBoundingClientRect();
|
top = rect.top;
|
||||||
top = rect.top - headRect.top - headRect.height;
|
if (Conf['Fixed Header'] && !Conf['Bottom Header']) {
|
||||||
|
headRect = Header.bar.getBoundingClientRect();
|
||||||
|
top += -headRect.top - headRect.height;
|
||||||
|
}
|
||||||
root = doc;
|
root = doc;
|
||||||
if (rect.top < 0) {
|
if (rect.top < 0) {
|
||||||
root.scrollTop += top;
|
root.scrollTop += top;
|
||||||
|
|||||||
@ -3119,8 +3119,11 @@
|
|||||||
if (!(rect.top <= 0 || rect.left <= 0)) {
|
if (!(rect.top <= 0 || rect.left <= 0)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
headRect = Header.bar.getBoundingClientRect();
|
top = rect.top;
|
||||||
top = rect.top - headRect.top - headRect.height;
|
if (Conf['Fixed Header'] && !Conf['Bottom Header']) {
|
||||||
|
headRect = Header.bar.getBoundingClientRect();
|
||||||
|
top += -headRect.top - headRect.height;
|
||||||
|
}
|
||||||
root = d.body;
|
root = d.body;
|
||||||
if (rect.top < 0) {
|
if (rect.top < 0) {
|
||||||
root.scrollTop += top;
|
root.scrollTop += top;
|
||||||
|
|||||||
@ -71,10 +71,11 @@ ImageExpand =
|
|||||||
rect = post.nodes.root.getBoundingClientRect()
|
rect = post.nodes.root.getBoundingClientRect()
|
||||||
return unless rect.top <= 0 or rect.left <= 0
|
return unless rect.top <= 0 or rect.left <= 0
|
||||||
|
|
||||||
# Scroll back to the thumbnail when contracting the image
|
{top} = rect
|
||||||
# to avoid being left miles away from the relevant post.
|
if Conf['Fixed Header'] and not Conf['Bottom Header']
|
||||||
headRect = Header.bar.getBoundingClientRect()
|
headRect = Header.bar.getBoundingClientRect()
|
||||||
top = rect.top - headRect.top - headRect.height
|
top += - headRect.top - headRect.height
|
||||||
|
|
||||||
root = <% if (type === 'crx') { %>d.body<% } else { %>doc<% } %>
|
root = <% if (type === 'crx') { %>d.body<% } else { %>doc<% } %>
|
||||||
|
|
||||||
root.scrollTop += top if rect.top < 0
|
root.scrollTop += top if rect.top < 0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user