diff -r 2a6033ca510e -r 00df963f91fb src/cm/media/js/client/c_sync.js --- a/src/cm/media/js/client/c_sync.js Tue Nov 02 16:31:20 2010 +0100 +++ b/src/cm/media/js/client/c_sync.js Mon Nov 08 12:41:44 2010 +0100 @@ -387,6 +387,20 @@ this._animateTo(topY) ; } }, + _showFocusSingleComment : function(topComment, focusComment) { + if (topComment != null) { + var topY = 0 ; + if (topComment['start_wrapper'] != -1) + topY = CY.get(".c-id-"+topComment.id).getY() ; + else + topY = CY.get('document').get('scrollTop') ; + + this._showComments([topComment.id], topY, false) ; + // optim when browsing comments with no reply + if (topComment.replies.length > 0) + this._animateToAndFocus(topY, focusComment.id) ; + } + }, showSingleComment : function(comment) { this._q.add({fn:CY.bind(this.setPreventClickOn, this)}) ; @@ -395,6 +409,13 @@ this._q.run(); }, + showFocusSingleComment : function(topComment, focusComment) { + this._q.add({fn:CY.bind(this.setPreventClickOn, this)}) ; + this._showFocusSingleComment(topComment, focusComment) ; + this._q.add({fn:CY.bind(this.setPreventClickOff, this)}) ; + this._q.run(); + }, + browse : function(order, whereto) { var comment = gIComments.browse(order, whereto) ; if (comment != null) @@ -436,6 +457,14 @@ ) ; }, + _animateToAndFocus : function(topY, focusCommentId) { + this._q.add({fn:function() { + gIComments.setAnimationToPositionsAndFocus(topY, focusCommentId) ; + }}, + {id:"animationRun", autoContinue:false, fn:CY.bind(gIComments.runAnimations, gIComments)} + ) ; + }, + _animateToTop : function() { var topPos = gIComments.getTopPosition() ; if (topPos != null)