@schneideress/dashboardframework 0.0.20 → 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.
@@ -513,6 +513,7 @@
513
513
  this.notifier = notifier;
514
514
  this.widgetList = Array();
515
515
  this.gridheight = 300;
516
+ this.isWidgetLoaded = false;
516
517
  this.widgetHeight = 20;
517
518
  this.widgetWidth = 50;
518
519
  }
@@ -534,7 +535,8 @@
534
535
  * @return {?}
535
536
  */
536
537
  function (changes) {
537
- if (this.globalFilter && this.raDashboardEventBus && this.appConfig) {
538
+ if (this.raDashboardEventBus && this.appConfig && !this.isWidgetLoaded) {
539
+ this.isWidgetLoaded = true;
538
540
  this.loadWidgets(this.userDashboardId, this.areaKey);
539
541
  }
540
542
  if (changes.raDashboardEventBus && changes.raDashboardEventBus.currentValue != changes.raDashboardEventBus.previousValue) {
@@ -1107,9 +1109,9 @@
1107
1109
  * @return {?}
1108
1110
  */
1109
1111
  function () {
1110
- _this.widgetElement = document.createElement(widgetInfo.customTag);
1111
- _this.ctlWidget.nativeElement.appendChild(_this.widgetElement);
1112
- setTimeout((/**
1112
+ widgetContainer.widgetElement = document.createElement(widgetInfo.customTag);
1113
+ widgetContainer.widgetElement.setAttribute("widget-instance-id", widgetInfo.widgetInstanceId);
1114
+ document.body.addEventListener('widgetinitiated' + widgetInfo.widgetInstanceId, (/**
1113
1115
  * @return {?}
1114
1116
  */
1115
1117
  function () {
@@ -1117,13 +1119,8 @@
1117
1119
  widgetConfigFilter.widgetInfo = (/** @type {?} */ ({}));
1118
1120
  widgetConfigFilter.widgetInfo.widgetName = widgetInfo.widgetName;
1119
1121
  widgetContainer.widgetElement.loadContent(widgetConfigFilter);
1120
- widgetContainer.widgetElement.addEventListener('load-data-initiated', (/**
1121
- * @param {?} hidePanel
1122
- * @return {?}
1123
- */
1124
- function (hidePanel) {
1125
- }));
1126
- }), 2000);
1122
+ }));
1123
+ _this.ctlWidget.nativeElement.appendChild(_this.widgetElement);
1127
1124
  }));
1128
1125
  };
1129
1126
  /** To refresh widget on input config changes */
@@ -1138,13 +1135,15 @@
1138
1135
  * @return {?}
1139
1136
  */
1140
1137
  function (widgetInfo) {
1138
+ /** @type {?} */
1139
+ var widgetContainerContext = this;
1141
1140
  /** @type {?} */
1142
1141
  var widgetConfigFilter = (/** @type {?} */ ({
1143
1142
  config: widgetInfo.widgetConfigInfo.config,
1144
1143
  globalFilter: this.globalFilter,
1145
1144
  appConfig: this.appConfig
1146
1145
  }));
1147
- this.widgetElement.loadContent(widgetConfigFilter);
1146
+ widgetContainerContext.widgetElement.loadContent(widgetConfigFilter);
1148
1147
  };
1149
1148
  RAWidgetContainer.decorators = [
1150
1149
  { type: core.Component, args: [{