Browse Source

HUE-8227 [dashboard] Make Grid and Chart widgets more compact

Enrico Berti 7 years ago
parent
commit
91e9cc434c

File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/css/hue-embedded.css


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/css/hue.css


File diff suppressed because it is too large
+ 0 - 0
desktop/core/src/desktop/static/desktop/css/hue3-extra.css


+ 1 - 2
desktop/core/src/desktop/static/desktop/less/components/hue-gridster.less

@@ -23,8 +23,7 @@
     & > li {
     & > li {
       border: 1px solid @cui-white;
       border: 1px solid @cui-white;
       background: @cui-white !important;
       background: @cui-white !important;
-      overflow-x: hidden;
-      overflow-y: auto;
+      overflow: hidden;
       h2 {
       h2 {
         cursor: move;
         cursor: move;
       }
       }

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

@@ -1758,7 +1758,7 @@ ${ dashboard.layout_skeleton(suffix='search') }
     <div>
     <div>
       <span data-bind="template: { name: 'facet-toggle2' }"></span>
       <span data-bind="template: { name: 'facet-toggle2' }"></span>
 
 
-      <div class="pull-right" style="margin-top: 40px">
+      <div class="pull-right">
 
 
       <!-- ko if: properties.isDate -->
       <!-- ko if: properties.isDate -->
         <div class="inline-block" style="padding-bottom: 10px; padding-right: 20px">
         <div class="inline-block" style="padding-bottom: 10px; padding-right: 20px">
@@ -3771,12 +3771,16 @@ function resizeFieldsListCallback() {
 
 
 var resizeTimeout = -1;
 var resizeTimeout = -1;
 function resizeFieldsListThrottled() {
 function resizeFieldsListThrottled() {
-  window.clearTimeout(resizeTimeout);
-  resizeTimeout = window.setTimeout(resizeFieldsListCallback, 200);
+  if (!searchViewModel.isGridster()) {
+    window.clearTimeout(resizeTimeout);
+    resizeTimeout = window.setTimeout(resizeFieldsListCallback, 200);
+  }
 }
 }
 
 
 function resizeFieldsList() {
 function resizeFieldsList() {
-  resizeFieldsListCallback();
+  if (!searchViewModel.isGridster()) {
+    resizeFieldsListCallback();
+  }
 }
 }
 
 
 function toggleDocDetails(doc) {
 function toggleDocDetails(doc) {
@@ -4691,6 +4695,24 @@ $(document).ready(function () {
     $(this).parent().addClass("active");
     $(this).parent().addClass("active");
   });
   });
 
 
+  $(document).on('dblclick', 'li.gs-w', function (event) {
+    var $gridsterWidget = $(event.target).parents('li.gs-w');
+
+    searchViewModel.gridItems().forEach(function (widget) {
+      if (widget.widgetId() === parseInt($gridsterWidget.data('widgetid'))) {
+        removeInternalScroll(widget);
+        var contentHeight = $(widget.gridsterElement).find('.card-widget').height();
+        if (widget.gridsterElement.clientHeight - contentHeight > (WIDGET_BASE_HEIGHT + 10)) {
+          widget.size_y(Math.ceil(contentHeight / (WIDGET_BASE_HEIGHT + 10)));
+          $gridster.resize_widget($(widget.gridsterElement), widget.size_x(), widget.size_y(), function () {
+            huePubSub.publish('gridster.clean.whitespace');
+            equalizeWidgetsHeights();
+          });
+        }
+      }
+    });
+  });
+
   $('.dashboard-container').on('click', function (e) {
   $('.dashboard-container').on('click', function (e) {
     huePubSub.publish('dashboard.hide.dimensions', e);
     huePubSub.publish('dashboard.hide.dimensions', e);
   });
   });

Some files were not shown because too many files changed in this diff