add possibility to set size of coWebsite and Jitsis via map property
This commit is contained in:
@@ -48,6 +48,10 @@ class CoWebsiteManager {
|
||||
this.cowebsiteDiv.style.width = width + "px";
|
||||
}
|
||||
|
||||
set widthPercent(width: number) {
|
||||
this.cowebsiteDiv.style.width = width + "%";
|
||||
}
|
||||
|
||||
get height(): number {
|
||||
return this.cowebsiteDiv.clientHeight;
|
||||
}
|
||||
@@ -162,7 +166,7 @@ class CoWebsiteManager {
|
||||
return iframe;
|
||||
}
|
||||
|
||||
public loadCoWebsite(url: string, base: string, allowApi?: boolean, allowPolicy?: string): void {
|
||||
public loadCoWebsite(url: string, base: string, allowApi?: boolean, allowPolicy?: string, widthpercent?: number): void {
|
||||
this.load();
|
||||
this.cowebsiteMainDom.innerHTML = ``;
|
||||
|
||||
@@ -186,6 +190,9 @@ class CoWebsiteManager {
|
||||
.then(() => Promise.race([onloadPromise, onTimeoutPromise]))
|
||||
.then(() => {
|
||||
this.open();
|
||||
if (widthpercent) {
|
||||
this.widthpercent = widthpercent;
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.fire();
|
||||
}, animationTime);
|
||||
@@ -199,13 +206,16 @@ class CoWebsiteManager {
|
||||
/**
|
||||
* Just like loadCoWebsite but the div can be filled by the user.
|
||||
*/
|
||||
public insertCoWebsite(callback: (cowebsite: HTMLDivElement) => Promise<void>): void {
|
||||
public insertCoWebsite(callback: (cowebsite: HTMLDivElement) => Promise<void>, jitsiWidth?: number): void {
|
||||
this.load();
|
||||
this.cowebsiteMainDom.innerHTML = ``;
|
||||
this.currentOperationPromise = this.currentOperationPromise
|
||||
.then(() => callback(this.cowebsiteMainDom))
|
||||
.then(() => {
|
||||
this.open();
|
||||
if (jitsiWidth) {
|
||||
this.widthpercent = jitsiWidth;
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.fire();
|
||||
}, animationTime);
|
||||
|
||||
Reference in New Issue
Block a user