Explorar el Código

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

Enrico Berti hace 7 años
padre
commit
4afd275

+ 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);