Improved cached widget height
This commit is contained in:
parent
0313565610
commit
3535bc9449
@ -52,13 +52,15 @@ class IFrameWidget extends WidgetType {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
iframe.style.height = `${this.estimatedHeight}px`;
|
||||||
|
|
||||||
return iframe;
|
return iframe;
|
||||||
}
|
}
|
||||||
|
|
||||||
get estimatedHeight(): number {
|
get estimatedHeight(): number {
|
||||||
const cachedHeight = this.editor.space.getCachedWidgetHeight(this.bodyText);
|
const cachedHeight = this.editor.space.getCachedWidgetHeight(this.bodyText);
|
||||||
// console.log("Calling estimated height", cachedHeight);
|
console.log("Calling estimated height", cachedHeight);
|
||||||
return cachedHeight || 150;
|
return cachedHeight > 0 ? cachedHeight : 150;
|
||||||
}
|
}
|
||||||
|
|
||||||
eq(other: WidgetType): boolean {
|
eq(other: WidgetType): boolean {
|
||||||
|
Loading…
Reference in New Issue
Block a user