|
|
|
@ -1545,20 +1545,19 @@ export class WidgetComponent extends PageComponent implements OnInit, AfterViewI |
|
|
|
} |
|
|
|
|
|
|
|
private checkSize(): boolean { |
|
|
|
const parentWidth = this.widgetContext.$containerParent.width(); |
|
|
|
const parentHeight = this.widgetContext.$containerParent.height(); |
|
|
|
const width = this.widgetContext.$container?.width(); |
|
|
|
const height = this.widgetContext.$container?.height(); |
|
|
|
const width = this.widgetContext.$containerParent.width(); |
|
|
|
const height = this.widgetContext.$containerParent.height(); |
|
|
|
let sizeChanged = false; |
|
|
|
|
|
|
|
if (parentWidth > 0 && parentHeight > 0) { |
|
|
|
if (!this.widgetContext.width || !this.widgetContext.height || width !== parentWidth || height !== parentHeight) { |
|
|
|
if (!this.widgetContext.width || this.widgetContext.width !== width || |
|
|
|
!this.widgetContext.height || this.widgetContext.height !== height) { |
|
|
|
if (width > 0 && height > 0) { |
|
|
|
if (this.widgetContext.$container) { |
|
|
|
this.widgetContext.$container.css('height', parentHeight + 'px'); |
|
|
|
this.widgetContext.$container.css('width', parentWidth + 'px'); |
|
|
|
this.widgetContext.$container.css('height', height + 'px'); |
|
|
|
this.widgetContext.$container.css('width', width + 'px'); |
|
|
|
} |
|
|
|
this.widgetContext.width = parentWidth; |
|
|
|
this.widgetContext.height = parentHeight; |
|
|
|
this.widgetContext.width = width; |
|
|
|
this.widgetContext.height = height; |
|
|
|
sizeChanged = true; |
|
|
|
this.widgetSizeDetected = true; |
|
|
|
} |
|
|
|
|