@schneideress/dashboardframework 0.0.19 → 0.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -296,7 +296,7 @@ const CompactType = {
296
296
  /** @type {?} */
297
297
  const GridsterConfigDefaultSettings = {
298
298
  gridType: GridType.ScrollVertical,
299
- compactType: CompactType.None,
299
+ compactType: CompactType.CompactLeftAndUp,
300
300
  margin: 0,
301
301
  outerMargin: true,
302
302
  outerMarginTop: null,
@@ -369,6 +369,7 @@ class RADashboardArea {
369
369
  this.notifier = notifier;
370
370
  this.widgetList = Array();
371
371
  this.gridheight = 300;
372
+ this.isWidgetLoaded = false;
372
373
  this.widgetHeight = 20;
373
374
  this.widgetWidth = 50;
374
375
  }
@@ -383,7 +384,8 @@ class RADashboardArea {
383
384
  * @return {?}
384
385
  */
385
386
  ngOnChanges(changes) {
386
- if (this.globalFilter && this.raDashboardEventBus && this.appConfig) {
387
+ if (this.raDashboardEventBus && this.appConfig && !this.isWidgetLoaded) {
388
+ this.isWidgetLoaded = true;
387
389
  this.loadWidgets(this.userDashboardId, this.areaKey);
388
390
  }
389
391
  if (changes.raDashboardEventBus && changes.raDashboardEventBus.currentValue != changes.raDashboardEventBus.previousValue) {
@@ -836,9 +838,9 @@ class RAWidgetContainer {
836
838
  * @return {?}
837
839
  */
838
840
  () => {
839
- this.widgetElement = document.createElement(widgetInfo.customTag);
840
- this.ctlWidget.nativeElement.appendChild(this.widgetElement);
841
- setTimeout((/**
841
+ widgetContainer.widgetElement = document.createElement(widgetInfo.customTag);
842
+ widgetContainer.widgetElement.setAttribute("widget-instance-id", widgetInfo.widgetInstanceId);
843
+ document.body.addEventListener('widgetinitiated' + widgetInfo.widgetInstanceId, (/**
842
844
  * @return {?}
843
845
  */
844
846
  () => {
@@ -846,13 +848,8 @@ class RAWidgetContainer {
846
848
  widgetConfigFilter.widgetInfo = (/** @type {?} */ ({}));
847
849
  widgetConfigFilter.widgetInfo.widgetName = widgetInfo.widgetName;
848
850
  widgetContainer.widgetElement.loadContent(widgetConfigFilter);
849
- widgetContainer.widgetElement.addEventListener('load-data-initiated', (/**
850
- * @param {?} hidePanel
851
- * @return {?}
852
- */
853
- (hidePanel) => {
854
- }));
855
- }), 2000);
851
+ }));
852
+ this.ctlWidget.nativeElement.appendChild(this.widgetElement);
856
853
  }));
857
854
  }
858
855
  /**
@@ -861,13 +858,15 @@ class RAWidgetContainer {
861
858
  * @return {?}
862
859
  */
863
860
  refreshWidget(widgetInfo) {
861
+ /** @type {?} */
862
+ let widgetContainerContext = this;
864
863
  /** @type {?} */
865
864
  let widgetConfigFilter = (/** @type {?} */ ({
866
865
  config: widgetInfo.widgetConfigInfo.config,
867
866
  globalFilter: this.globalFilter,
868
867
  appConfig: this.appConfig
869
868
  }));
870
- this.widgetElement.loadContent(widgetConfigFilter);
869
+ widgetContainerContext.widgetElement.loadContent(widgetConfigFilter);
871
870
  }
872
871
  }
873
872
  RAWidgetContainer.decorators = [