瀏覽代碼

HUE-7949 [dashboard] Avoid shrinking empty widgets when hovering them

Enrico Berti 7 年之前
父節點
當前提交
89dd8c6

文件差異過大導致無法顯示
+ 0 - 0
desktop/libs/dashboard/src/dashboard/static/dashboard/css/common_dashboard.css


+ 1 - 1
desktop/libs/dashboard/src/dashboard/static/dashboard/less/common_dashboard.less

@@ -209,7 +209,7 @@
   }
 
   .droppable-hover {
-    background-color: @cui-gray-200 !important;
+    background-color: @cui-gray-050 !important;
   }
 
   .with-top-margin {

+ 2 - 1
desktop/libs/dashboard/src/dashboard/templates/common_search.mako

@@ -3816,7 +3816,8 @@ $(document).ready(function () {
           sizey: parseInt($(this).attr('data-immutable-sizey'))
         }
         var $widget = $(this);
-        if (coords.col >= dimensions.col && coords.row >= dimensions.row && coords.col < dimensions.col + dimensions.sizex && coords.row < dimensions.row + dimensions.sizey) {
+        var isEmptyWidget = $widget.children('.empty-gridster-widget').length;
+        if (coords.col >= dimensions.col && coords.row >= dimensions.row && coords.col < dimensions.col + dimensions.sizex && coords.row < dimensions.row + dimensions.sizey && !isEmptyWidget) {
           overlaps = true;
           var sidesWidth = Math.floor(dimensions.sizex / 3);
           var centerWidth = dimensions.sizex - sidesWidth * 2;

部分文件因文件數量過多而無法顯示