浏览代码

[notebook] Fixed results height and reduced default size of Ace editor

Enrico Berti 10 年之前
父节点
当前提交
4c3b9ffba1

+ 2 - 1
desktop/core/src/desktop/static/desktop/js/jquery.tablescroller.js

@@ -29,6 +29,7 @@
   var pluginName = "jHueTableScroller",
       defaults = {
         minHeight: 300,
+        maxHeight: -1,
         heightAfterCorrection: 40
       };
 
@@ -85,7 +86,7 @@
       heightCondition = true;
     }
 
-    var fixedHeight = $(_this.element).find("table").eq(0).data("tablescroller-fixed-height") || -1;
+    var fixedHeight = $(_this.element).find("table").eq(0).data("tablescroller-fixed-height") || _this.options.maxHeight;
 
     if (heightCondition) {
       var specificMinHeight = $(el).find("table").eq(0).data("tablescroller-min-height");

+ 1 - 1
desktop/core/src/desktop/static/desktop/js/ko.hue-bindings.js

@@ -1683,7 +1683,7 @@ ko.bindingHandlers.aceEditor = {
       showGutter: false,
       showLineNumbers: false,
       showPrintMargin: false,
-      minLines: 6,
+      minLines: 1,
       maxLines: 25
     };
 

+ 1 - 1
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -463,7 +463,7 @@ var Snippet = function (vm, notebook, snippet) {
     var _initialIndex = self.result.data().length;
     var _tempData = [];
     $.each(data.result.data, function (index, row) {
-      row.unshift(_initialIndex + index);
+      row.unshift(_initialIndex + index + 1);
       self.result.data.push(row);
       _tempData.push(row);
     });

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

@@ -1233,7 +1233,7 @@ from desktop.views import _ko
       },
       "fnDrawCallback": function (oSettings) {
         $(el).parents(".dataTables_wrapper").jHueTableScroller({
-          minHeight: Math.max($(window).height() - 400, 300),
+          maxHeight: 330,
           heightAfterCorrection: 0
         });
 
@@ -1260,7 +1260,7 @@ from desktop.views import _ko
       ]
     });
     $(el).parents(".dataTables_wrapper").jHueTableScroller({
-      minHeight: Math.max($(window).height() - 400, 300),
+      maxHeight: 330,
       heightAfterCorrection: 0
     });