浏览代码

HUE-8133 [dashboard] Maximize the grid space when loading a saved dashboard too

Enrico Berti 7 年之前
父节点
当前提交
8e0a86f3aa
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      desktop/core/src/desktop/static/desktop/js/gridster-knockout.js

+ 2 - 1
desktop/core/src/desktop/static/desktop/js/gridster-knockout.js

@@ -71,6 +71,8 @@ ko.bindingHandlers.gridster = {
         });
       ko.applyBindingsToDescendants(childBindingContext, addedWidget.get(0));
 
+      huePubSub.publish('gridster.added.widget', addedWidget);
+
       return addedWidget;
     };
 
@@ -93,7 +95,6 @@ ko.bindingHandlers.gridster = {
         switch (change.status) {
           case 'added':
             var addedWidget = addWidget(change.value);
-            huePubSub.publish('gridster.added.widget', addedWidget);
             if (change.value.callback) {
               ko.unwrap(change.value.callback)(addedWidget);
             }