src/cm/media/js/client/c_icomments.js
changeset 337 614669e0e313
parent 331 7ddb9fa9c3f2
child 341 053551f213fb
equal deleted inserted replaced
336:f7fb42d3f526 337:614669e0e313
   170 					nextY += iComment.getHeight() ;
   170 					nextY += iComment.getHeight() ;
   171 				}
   171 				}
   172 			}
   172 			}
   173 		},
   173 		},
   174 		
   174 		
   175 		setAnimationToPositionsAndFocus : function (y, focusCommentId) {
   175 		setAnimationToPositionsAndFocus : function (y, focusCommentId, reply) {
   176 			this._initAnimations();
   176 			this._initAnimations();
   177 			var lpad = (gPrefs.get('comments','threadpad') == '1') ? gConf['iCommentThreadPadding'] : 0 ;
   177 			var lpad = (gPrefs.get('comments','threadpad') == '1') ? gConf['iCommentThreadPadding'] : 0 ;
   178 
   178 
   179 			var nextY = y ;
   179 			var nextY = y ;
   180 			for (var i = 0 ; i < this._c.length;i++) {
   180 			for (var i = 0 ; i < this._c.length;i++) {
   187 						var xy = iComment.getPosition() ;
   187 						var xy = iComment.getPosition() ;
   188 						nextY = xy[1] ;
   188 						nextY = xy[1] ;
   189 					}
   189 					}
   190 					
   190 					
   191           if (iComment.commentId >= focusCommentId)
   191           if (iComment.commentId >= focusCommentId)
   192   					this._a.push(iComment.setAnimationToPosition([iCommentX, nextY], focusCommentId)) ;
   192   					this._a.push(iComment.setAnimationToPosition([iCommentX, nextY], focusCommentId, reply)) ;
   193           else
   193           else
   194   					this._a.push(iComment.setAnimationToPosition([iCommentX, nextY])) ;
   194   					this._a.push(iComment.setAnimationToPosition([iCommentX, nextY])) ;
   195 					nextY += iComment.getHeight() ;
   195 					nextY += iComment.getHeight() ;
   196 				}
   196 				}
   197 			}
   197 			}
   219       if ("comment_id_key" in gGETValues) {
   219       if ("comment_id_key" in gGETValues) {
   220         var id_key = gGETValues["comment_id_key"];
   220         var id_key = gGETValues["comment_id_key"];
   221         var focusComment = gDb.getCommentByIdKey(id_key);
   221         var focusComment = gDb.getCommentByIdKey(id_key);
   222         if (focusComment != null)
   222         if (focusComment != null)
   223           gIComments.getIComment(focusComment.id).overlay.focus();
   223           gIComments.getIComment(focusComment.id).overlay.focus();
       
   224       }
       
   225 			gSync.resume();
       
   226 		},
       
   227 		
       
   228 		whenAnimationsEndReply : function () {
       
   229       gGETValues = CY.JSON.parse(sv_get_params);
       
   230       if ("comment_id_key" in gGETValues) {
       
   231         var id_key = gGETValues["comment_id_key"];
       
   232         var focusComment = gDb.getCommentByIdKey(id_key);
       
   233         if (focusComment != null) {
       
   234           gSync.showReplyForm(gIComments.getIComment(focusComment.id));
       
   235         }
   224       }
   236       }
   225 			gSync.resume();
   237 			gSync.resume();
   226 		},
   238 		},
   227 		
   239 		
   228 		animationsEnded : function () {
   240 		animationsEnded : function () {