@schneideress/dashboardframework 0.0.13 → 0.0.15

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.
@@ -399,6 +399,8 @@
399
399
  WidgetDelete: "WidgetDelete",
400
400
  /** used to add widget to widgetlist when user copies a widget to current dashboard */
401
401
  AddWidget: "AddWidget",
402
+ /** done button click on widget library flyout */
403
+ widgetLibraryDoneClick: "widgetLibraryDoneClick",
402
404
  };
403
405
  /** @enum {string} */
404
406
  var RAEventKey = {
@@ -532,9 +534,10 @@
532
534
  * @return {?}
533
535
  */
534
536
  function (changes) {
535
- if (this.raDashboardEventBus && this.userDashboardId && this.areaKey) {
536
- this.initiateGridsterConfig();
537
+ if (this.globalFilter && this.raDashboardEventBus && this.appConfig) {
537
538
  this.loadWidgets(this.userDashboardId, this.areaKey);
539
+ }
540
+ if (changes.raDashboardEventBus.currentValue != changes.raDashboardEventBus.previousValue) {
538
541
  this.inititateEventBusSubscritions();
539
542
  }
540
543
  };
@@ -608,6 +611,27 @@
608
611
  _this.addWidget(e);
609
612
  }));
610
613
  }));
614
+ this.widgetLibraryDoneClick = this.raDashboardEventBus.subscribe(RAEvent.widgetLibraryDoneClick).subscribe((/**
615
+ * @param {?} widgetList
616
+ * @return {?}
617
+ */
618
+ function (widgetList) {
619
+ _this.ngZone.run((/**
620
+ * @return {?}
621
+ */
622
+ function () {
623
+ console.log(widgetList);
624
+ if (widgetList) {
625
+ widgetList.forEach((/**
626
+ * @param {?} widgetInfo
627
+ * @return {?}
628
+ */
629
+ function (widgetInfo) {
630
+ _this.addWidget(widgetInfo);
631
+ }));
632
+ }
633
+ }));
634
+ }));
611
635
  };
612
636
  /**
613
637
  * @return {?}
@@ -619,6 +643,7 @@
619
643
  this.conifgAddClick.unsubscribe();
620
644
  this.widgetAddEvent.unsubscribe();
621
645
  this.widgetDeleteEvent.unsubscribe();
646
+ this.widgetLibraryDoneClick.unsubscribe();
622
647
  };
623
648
  /**To update position/dimention of all widgets in the area */
624
649
  /**
@@ -667,12 +692,7 @@
667
692
  function (widgets) {
668
693
  if (widgets && widgets.length > 0) {
669
694
  areaContext.widgetList = _this.mapObjectListToGridsterItemList(widgets);
670
- setTimeout((/**
671
- * @return {?}
672
- */
673
- function () {
674
- areaContext.setAreaHeight();
675
- }), 2000);
695
+ areaContext.setAreaHeight();
676
696
  }
677
697
  }));
678
698
  };
@@ -2598,12 +2618,6 @@
2598
2618
  if (this.options.destroyCallback) {
2599
2619
  this.options.destroyCallback(this);
2600
2620
  }
2601
- if (this.options.api) {
2602
- this.options.api.resize = undefined;
2603
- this.options.api.optionsChanged = undefined;
2604
- this.options.api.getNextPossiblePosition = undefined;
2605
- this.options.api = undefined;
2606
- }
2607
2621
  this.emptyCell.destroy();
2608
2622
  delete this.emptyCell;
2609
2623
  this.compact.destroy();