1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-01 14:05:07 +03:00

fix прокрутки комментов, теперь большие комменты корректно центрируются на экране

This commit is contained in:
Mzhelskiy Maxim 2009-05-03 09:41:03 +00:00
parent 78420d1459
commit 929f8867ab

View file

@ -214,8 +214,13 @@ var lsCmtTreeClass = new Class({
'x': 0,
'y': 0
}
});
this.docScroller.start(0,$('comment_id_'+idComment).getPosition().y-window.getSize().y/2);
});
var cmt=$('comment_id_'+idComment);
var deltaY=cmt.getDimensions().height/2-window.getSize().y/2;
if (deltaY>0) {
deltaY=0;
}
this.docScroller.start(0,cmt.getPosition().y+deltaY);
if (this.iCommentIdLastView) {
$('comment_content_id_'+this.iCommentIdLastView).removeClass('view');
}