瀏覽代碼

HUE-7303 [editor] Avoid result grid size expansion on presentation mode

Enrico Berti 8 年之前
父節點
當前提交
7869e92

+ 3 - 0
desktop/core/src/desktop/static/desktop/js/jquery.tablescroller.js

@@ -107,6 +107,9 @@
         }
       }
     }
+    else if (fixedHeight > -1){
+      $(el).css("overflow-y", "auto").css("maxHeight", fixedHeight);
+    }
   }
 
   $.fn[pluginName] = function (options) {

+ 2 - 2
desktop/libs/notebook/src/notebook/templates/editor_components.mako

@@ -2179,7 +2179,7 @@ ${ sqlSyntaxDropdown.sqlSyntaxDropdown() }
             %endif
             if (snippet.isResultSettingsVisible()) {
               snippetEl.find('.snippet-grid-settings').css({
-                "height": vm.isPresentationMode() ? '330px' : Math.max(100, Math.ceil($(window).height() - Math.max($('#queryResults').offset().top, topCoord)))+ 'px'
+                "height": vm.isPresentationMode() || !vm.editorMode() ? '330px' : Math.max(100, Math.ceil($(window).height() - Math.max($('#queryResults').offset().top, topCoord)))+ 'px'
               });
               snippetEl.find('.result-settings').animate({
                 'marginTop': margin
@@ -3476,7 +3476,7 @@ ${ sqlSyntaxDropdown.sqlSyntaxDropdown() }
           _dtElement = $("#snippet_" + snippet.id()).find(".dataTables_wrapper");
           var topCoord = viewModel.isPresentationMode() || viewModel.isResultFullScreenMode() ? ${ conf.CUSTOM.BANNER_TOP_HTML.get() and '31' or '1' } : 73;
           $("#snippet_" + snippet.id()).find(".snippet-grid-settings").css({
-            "height": viewModel.isPresentationMode() ? '330px' : Math.ceil($(window).height() - Math.max($('.result-settings').length > 0 ? $('.result-settings').offset().top : 0, topCoord)) + 'px'
+            "height": viewModel.isPresentationMode() || !viewModel.editorMode() ? '330px' : Math.ceil($(window).height() - Math.max($('.result-settings').length > 0 ? $('.result-settings').offset().top : 0, topCoord)) + 'px'
           });
         } else {
           _dtElement = $("#snippet_" + snippet.id()).find(".chart:visible");