浏览代码

HUE-7907 [dashboard] Remove whitespaces on widget drag, resize, remove and add

Enrico Berti 7 年之前
父节点
当前提交
da6c018f29
共有 1 个文件被更改,包括 9 次插入0 次删除
  1. 9 0
      desktop/libs/dashboard/src/dashboard/templates/common_search.mako

+ 9 - 0
desktop/libs/dashboard/src/dashboard/templates/common_search.mako

@@ -3789,8 +3789,14 @@ $(document).ready(function () {
       },
       stop: function (event, ui, $widget) {
         huePubSub.publish('resize.plotly.chart');
+        huePubSub.publish('gridster.clean.whitespace');
         $widget.find('.card-widget').height($widget.height()).css('opacity', '1');
       },
+    },
+    draggable: {
+      stop: function (e, ui, $widget) {
+        huePubSub.publish('gridster.clean.whitespace');
+      }
     }
   });
 
@@ -4100,6 +4106,7 @@ $(document).ready(function () {
       $gridster.move_widget($(widget.gridsterElement), ((i - 1) * optimalWidgetWidth) + 1, widget.row());
     }
     searchViewModel.gridItems.remove(gridElement);
+    huePubSub.publish('gridster.clean.whitespace');
   }, 'dashboard')
 
   huePubSub.subscribe('gridster.remove.widget', function (widgetId) {
@@ -4125,6 +4132,7 @@ $(document).ready(function () {
             }
             item.size_y(targetHeight);
             $('.gridster ul').data('gridster').resize_widget($(item.gridsterElement), item.size_x(), item.size_y());
+            huePubSub.publish('gridster.clean.whitespace');
           }
         });
       }
@@ -4139,6 +4147,7 @@ $(document).ready(function () {
             widget: widget,
             callback: function (el) {
               $('.gridster ul').data('gridster').move_widget(el, 1, 1);
+              huePubSub.publish('gridster.clean.whitespace');
             }
           })
         );