Explorar el Código

HUE-7546 [dashboard] Automatically apply height to the Gridster widgets on Leaflet draw

Enrico Berti hace 8 años
padre
commit
b3d7068aba

+ 3 - 0
desktop/core/src/desktop/static/desktop/js/ko.charts.leaflet.js

@@ -158,6 +158,9 @@
                 _map.on("zoomend", function () {
                   _onRegionChange(_map.getBounds());
                 });
+                _map.on("viewreset", function(){
+                  huePubSub.publish('leaflet.afterplot', element);
+                });
               }
 
             }

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

@@ -3666,6 +3666,10 @@ $(document).ready(function () {
     resizeGridsterWidget($(element).parents('li.gs-w'));
   }, 'dashboard');
 
+  huePubSub.subscribe('leaflet.afterplot', function (element){
+    resizeGridsterWidget($(element).parents('li.gs-w'));
+  }, 'dashboard');
+
 %endif
 
   $(document).on("click", ".widget-settings-pill", function(){