Merge pull request #120 from ahodesuka/master

Fix scroll offset when contracting images, #104
This commit is contained in:
Mayhem 2012-01-19 19:23:09 -08:00
commit d3806e293f
2 changed files with 7 additions and 1 deletions

View File

@ -2991,9 +2991,12 @@
}
},
toggle: function(a) {
var thumb;
var rect, thumb;
thumb = a.firstChild;
if (thumb.hidden) {
rect = a.parentNode.getBoundingClientRect();
if (rect.top < 0) d.body.scrollTop += rect.top;
if (rect.left < 0) d.body.scrollLeft += rect.left;
return imgExpand.contract(thumb);
} else {
return imgExpand.expand(thumb);

View File

@ -2316,6 +2316,9 @@ imgExpand =
toggle: (a) ->
thumb = a.firstChild
if thumb.hidden
rect = a.parentNode.getBoundingClientRect()
d.body.scrollTop += rect.top if rect.top < 0
d.body.scrollLeft += rect.left if rect.left < 0
imgExpand.contract thumb
else
imgExpand.expand thumb