mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-04 12:14:12 +00:00 
			
		
		
		
	Made slimscroll more user friendly when scrolling up in conversations
This commit is contained in:
		@@ -759,6 +759,9 @@ ComunicWeb.components.conversations.chatWindows = {
 | 
				
			|||||||
		//Else extract conversation informations
 | 
							//Else extract conversation informations
 | 
				
			||||||
		var conv = this.__conversationsCache["conversation-"+conversationID];
 | 
							var conv = this.__conversationsCache["conversation-"+conversationID];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							//Save the position of the oldest message element
 | 
				
			||||||
 | 
							var currOldestMessageElem = conv.messages[0].rootElem;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		//Process the list of messages in reverse order
 | 
							//Process the list of messages in reverse order
 | 
				
			||||||
		messages.reverse();
 | 
							messages.reverse();
 | 
				
			||||||
		messages.forEach(function(message){
 | 
							messages.forEach(function(message){
 | 
				
			||||||
@@ -777,6 +780,13 @@ ComunicWeb.components.conversations.chatWindows = {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							//Update slimscroll
 | 
				
			||||||
 | 
							newScrollPos = currOldestMessageElem.offsetTop - 30;
 | 
				
			||||||
 | 
							if(newScrollPos < 0)
 | 
				
			||||||
 | 
								newScrollPos = 0;
 | 
				
			||||||
 | 
							$(conv.box.messagesArea).slimScroll({
 | 
				
			||||||
 | 
								scrollTo: newScrollPos + "px"
 | 
				
			||||||
 | 
							});
 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/**
 | 
						/**
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user