mirror of
				https://github.com/pierre42100/ComunicWeb
				synced 2025-11-03 19:54:14 +00:00 
			
		
		
		
	Start to anchor video calls
This commit is contained in:
		@@ -334,7 +334,7 @@ const ConversationPageConvPart = {
 | 
			
		||||
				//Enable / update slimscroll
 | 
			
		||||
				var target = ComunicWeb.pages.conversations.conversation._conv_info.window.messagesTarget;
 | 
			
		||||
				var scrollBottom = $(target).prop("scrollHeight")+"px";
 | 
			
		||||
				ComunicWeb.pages.conversations.utils.enableSlimScroll(target, ComunicWeb.pages.conversations.utils.getAvailableHeight(), scrollBottom);
 | 
			
		||||
				//ComunicWeb.pages.conversations.utils.enableSlimScroll(target, "100%", scrollBottom);
 | 
			
		||||
 | 
			
		||||
			}, 100);
 | 
			
		||||
		}
 | 
			
		||||
@@ -580,10 +580,10 @@ const ConversationPageConvPart = {
 | 
			
		||||
				newScrollPos = oldestMessage.offsetTop - 30;
 | 
			
		||||
				if(newScrollPos < 0)
 | 
			
		||||
					newScrollPos = 0;
 | 
			
		||||
				ComunicWeb.pages.conversations.utils.enableSlimScroll(
 | 
			
		||||
					convInfo.window.messagesTarget, 
 | 
			
		||||
					ComunicWeb.pages.conversations.utils.getAvailableHeight(), 
 | 
			
		||||
					newScrollPos);
 | 
			
		||||
				/*ComunicWeb.pages.conversations.utils.enableSlimScroll(
 | 
			
		||||
					convInfo.window.messagesTarget,
 | 
			
		||||
					"100%", 
 | 
			
		||||
					newScrollPos);*/
 | 
			
		||||
			});
 | 
			
		||||
		});
 | 
			
		||||
	},
 | 
			
		||||
 
 | 
			
		||||
@@ -23,6 +23,14 @@ ComunicWeb.pages.conversations.main = {
 | 
			
		||||
 | 
			
		||||
		//Check if a conversation has to be opened
 | 
			
		||||
		if(args.subfolder){
 | 
			
		||||
 | 
			
		||||
			// Add a target for video calls
 | 
			
		||||
			createElem2({
 | 
			
		||||
				appendTo: container,
 | 
			
		||||
				type: "div",
 | 
			
		||||
				id: "target-for-video-call-"+this.getCurrentConversationID()
 | 
			
		||||
			})
 | 
			
		||||
 | 
			
		||||
			ComunicWeb.pages.conversations.conversation.open(this.getCurrentConversationID(), container);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -10,14 +10,14 @@ ComunicWeb.pages.conversations.utils = {
 | 
			
		||||
	 * Enable slimscroll for the conversation element
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param {HMTLElement} target The target for slimscroll
 | 
			
		||||
	 * @param {Number} height The available height for the element
 | 
			
		||||
	 * @param {Number|String} height The available height for the element
 | 
			
		||||
	 * @param {Number} pos Scroll position to go to
 | 
			
		||||
	 */
 | 
			
		||||
	enableSlimScroll: function(target, height, pos){
 | 
			
		||||
 | 
			
		||||
		$(target).slimScroll({
 | 
			
		||||
			scrollTo: pos + "px",
 | 
			
		||||
			height: height + "px",
 | 
			
		||||
			height: height + (typeof height == "number" ? "px" : ""),
 | 
			
		||||
		});
 | 
			
		||||
	},
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user