浏览代码

HUE-7907 [dashboard] Recalculate grid base width on window resize

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

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

@@ -3767,6 +3767,7 @@ $(document).ready(function () {
     window.setTimeout(function(){
       resizeFieldsList();
     }, 200);
+    huePubSub.publish('dashboard.window.resize');
   });
 
 %if USE_GRIDSTER.get():
@@ -3839,6 +3840,10 @@ $(document).ready(function () {
   var widgetGridHeight = parseInt(hueUtils.getStyleFromCSSClass('[data-sizey="1"]').height);
   var widgetGridWidth = parseInt(hueUtils.getStyleFromCSSClass('[data-sizex="1"]').width);
 
+  huePubSub.subscribe('dashboard.window.resize', function () {
+    widgetGridWidth = parseInt(hueUtils.getStyleFromCSSClass('[data-sizex="1"]').width);
+  }, 'dashboard');
+
   function restoreWidgetSizes() {
     $('li.gs-w').each(function () {
       var $widget = $(this);