فهرست منبع

HUE-7612 [dashboard] Recalculate height of non graphical widgets

Enrico Berti 8 سال پیش
والد
کامیت
37ceb7dad3
1فایلهای تغییر یافته به همراه4 افزوده شده و 2 حذف شده
  1. 4 2
      desktop/libs/dashboard/src/dashboard/templates/common_search.mako

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

@@ -3625,8 +3625,10 @@ $(document).ready(function () {
     }
   });
 
-  function resizeGridsterWidget($el){
-    $(".gridster>ul").data('gridster').resize_widget($el, $el.data('sizex'), Math.ceil($el.find('.card-widget').height() / WIDGET_BASE_HEIGHT));
+  function resizeGridsterWidget($el) {
+    if ($el.find('.card-widget').length > 0) {
+      $(".gridster>ul").data('gridster').resize_widget($el, $el.data('sizex'), Math.ceil($el.find('.card-widget').height() / WIDGET_BASE_HEIGHT));
+    }
   }
 
   huePubSub.subscribeOnce('calculate.gridster.heights', function () {