mirror of
https://github.com/pierre42100/ComunicWeb
synced 2025-06-18 20:05:16 +00:00
Start to anchor video calls
This commit is contained in:
@ -131,4 +131,9 @@ document.addEventListener("openPage", () => {
|
||||
if(!OpenCalls.has(c))
|
||||
CallsController.Open(await getSingleConversation(c))
|
||||
})
|
||||
|
||||
// Check if a conversation can be integrated inside the page
|
||||
for(const call of OpenCalls.values()) {
|
||||
call.CheckNewTargetForWindow()
|
||||
}
|
||||
})
|
@ -212,6 +212,9 @@ class CallWindow extends CustomEvents {
|
||||
|
||||
|
||||
|
||||
// Check for anchors
|
||||
this.CheckNewTargetForWindow()
|
||||
|
||||
|
||||
|
||||
// Join the call
|
||||
@ -244,6 +247,25 @@ class CallWindow extends CustomEvents {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if current call window can be applied somewhere on the screen
|
||||
*/
|
||||
CheckNewTargetForWindow() {
|
||||
const target = byId("target-for-video-call-"+this.callID)
|
||||
|
||||
this.rootEl.remove()
|
||||
|
||||
if(target) {
|
||||
target.appendChild(this.rootEl)
|
||||
this.rootEl.classList.add("embedded")
|
||||
}
|
||||
|
||||
else {
|
||||
byId("callsTarget").appendChild(this.rootEl)
|
||||
this.rootEl.classList.remove("embedded")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if this conversation window is open or not
|
||||
*
|
||||
|
Reference in New Issue
Block a user