This commit is contained in:
Nicolas Stepien 2012-05-14 17:58:38 +02:00
parent 97bfd4b55b
commit fc8295925c
2 changed files with 20 additions and 7 deletions

View File

@ -3807,12 +3807,21 @@
thumb = a.firstChild; thumb = a.firstChild;
if (thumb.hidden) { if (thumb.hidden) {
rect = a.getBoundingClientRect(); rect = a.getBoundingClientRect();
if ($.engine === 'webkit') {
if (rect.top < 0) { if (rect.top < 0) {
d.body.scrollTop += rect.top - 42; d.body.scrollTop += rect.top - 42;
} }
if (rect.left < 0) { if (rect.left < 0) {
d.body.scrollLeft += rect.left; d.body.scrollLeft += rect.left;
} }
} else {
if (rect.top < 0) {
d.documentElement.scrollTop += rect.top - 42;
}
if (rect.left < 0) {
d.documentElement.scrollLeft += rect.left;
}
}
return ImageExpand.contract(thumb); return ImageExpand.contract(thumb);
} else { } else {
return ImageExpand.expand(thumb); return ImageExpand.expand(thumb);

View File

@ -2907,8 +2907,12 @@ ImageExpand =
thumb = a.firstChild thumb = a.firstChild
if thumb.hidden if thumb.hidden
rect = a.getBoundingClientRect() rect = a.getBoundingClientRect()
if $.engine is 'webkit'
d.body.scrollTop += rect.top - 42 if rect.top < 0 d.body.scrollTop += rect.top - 42 if rect.top < 0
d.body.scrollLeft += rect.left if rect.left < 0 d.body.scrollLeft += rect.left if rect.left < 0
else
d.documentElement.scrollTop += rect.top - 42 if rect.top < 0
d.documentElement.scrollLeft += rect.left if rect.left < 0
ImageExpand.contract thumb ImageExpand.contract thumb
else else
ImageExpand.expand thumb ImageExpand.expand thumb