mirror of
				https://github.com/vector-im/element-web.git
				synced 2025-11-04 10:11:03 +01:00 
			
		
		
		
	If read receipts avatar isn't on screen, animate it from the top of the screen.
This commit is contained in:
		
							parent
							
								
									09b0d221df
								
							
						
					
					
						commit
						f7fe871fee
					
				@ -131,11 +131,15 @@ module.exports = React.createClass({
 | 
				
			|||||||
            var oldAvatarDomNode = document.getElementById('mx_readAvatar'+member.userId);
 | 
					            var oldAvatarDomNode = document.getElementById('mx_readAvatar'+member.userId);
 | 
				
			||||||
            var startStyles = [];
 | 
					            var startStyles = [];
 | 
				
			||||||
            var enterTransitionOpts = [];
 | 
					            var enterTransitionOpts = [];
 | 
				
			||||||
            if (oldAvatarDomNode && this.readAvatarRect) {
 | 
					            var oldNodeTop = -15; // For avatars that weren't on screen, act as if they were just off the top
 | 
				
			||||||
                var oldRect = oldAvatarDomNode.getBoundingClientRect();
 | 
					            if (oldAvatarDomNode) {
 | 
				
			||||||
                var topOffset = oldRect.top - this.readAvatarRect.top;
 | 
					                oldNodeTop = oldAvatarDomNode.getBoundingClientRect().top;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (oldAvatarDomNode.style.left !== '0px') {
 | 
					            if (this.readAvatarRect) {
 | 
				
			||||||
 | 
					                var topOffset = oldNodeTop - this.readAvatarRect.top;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                if (oldAvatarDomNode && oldAvatarDomNode.style.left !== '0px') {
 | 
				
			||||||
                    var leftOffset = oldAvatarDomNode.style.left;
 | 
					                    var leftOffset = oldAvatarDomNode.style.left;
 | 
				
			||||||
                    // start at the old height and in the old h pos
 | 
					                    // start at the old height and in the old h pos
 | 
				
			||||||
                    startStyles.push({ top: topOffset, left: leftOffset });
 | 
					                    startStyles.push({ top: topOffset, left: leftOffset });
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user