Replace ternary operator with simple if

This commit is contained in:
ahodesuka 2012-01-18 22:55:16 -06:00
parent 791c3fcd78
commit 8f29d8eac9
2 changed files with 8 additions and 4 deletions

View File

@ -2995,8 +2995,12 @@
thumb = a.firstChild;
if (thumb.hidden) {
rect = a.getBoundingClientRect();
d.body.scrollTop += rect.top < 0 ? rect.top + thumb.height / (rect.height / rect.top * -1) : 0;
d.body.scrollLeft += rect.left < 0 ? rect.left + thumb.width / (rect.width / rect.left * -1) : 0;
if (rect.top < 0) {
d.body.scrollTop += rect.top + thumb.height / (rect.height / rect.top * -1);
}
if (rect.left < 0) {
d.body.scrollLeft += rect.left + thumb.width / (rect.width / rect.left * -1);
}
return imgExpand.contract(thumb);
} else {
return imgExpand.expand(thumb);

View File

@ -2317,8 +2317,8 @@ imgExpand =
thumb = a.firstChild
if thumb.hidden
rect = a.getBoundingClientRect()
d.body.scrollTop += if rect.top < 0 then rect.top + thumb.height / (rect.height / rect.top * -1) else 0
d.body.scrollLeft += if rect.left < 0 then rect.left + thumb.width / (rect.width / rect.left * -1) else 0
d.body.scrollTop += rect.top + thumb.height / (rect.height / rect.top * -1) if rect.top < 0
d.body.scrollLeft += rect.left + thumb.width / (rect.width / rect.left * -1) if rect.left < 0
imgExpand.contract thumb
else
imgExpand.expand thumb