Răsfoiți Sursa

HUE-4434 [editor] Fixed header has a wrong offset in fullscreen when the editor is manually resized

Enrico Berti 9 ani în urmă
părinte
comite
0ebb0134ff

+ 4 - 0
desktop/core/src/desktop/static/desktop/css/hue3.css

@@ -624,6 +624,10 @@ table.display td.center {
   vertical-align: middle!important;
 }
 
+.table-huedatatable {
+  margin-bottom: 0!important;
+}
+
 .table-huedatatable th.sorting {
   cursor: default;
   background: none;

+ 14 - 6
desktop/core/src/desktop/static/desktop/js/jquery.tableextender.js

@@ -335,9 +335,13 @@
 
 
     function positionClones() {
-      if (plugin.options.stickToTopPosition > -1) {
-        if ($pluginElement.offset().top < plugin.options.stickToTopPosition) {
-          clonedCellVisibleContainer.css("top", plugin.options.stickToTopPosition + "px");
+      var pos = plugin.options.stickToTopPosition;
+      if (typeof pos === 'function'){
+        pos = pos();
+      }
+      if (pos > -1) {
+        if ($pluginElement.offset().top < pos) {
+          clonedCellVisibleContainer.css("top", pos + "px");
         }
         else {
           clonedCellVisibleContainer.css("top", $pluginElement.offset().top + "px");
@@ -443,9 +447,13 @@
     });
 
     function positionClones() {
-      if (plugin.options.stickToTopPosition > -1) {
-        if ($pluginElement.offset().top < plugin.options.stickToTopPosition) {
-          clonedTableVisibleContainer.css("top", plugin.options.stickToTopPosition + "px");
+      var pos = plugin.options.stickToTopPosition;
+      if (typeof pos === 'function'){
+        pos = pos();
+      }
+      if (pos > -1) {
+        if ($pluginElement.offset().top < pos) {
+          clonedTableVisibleContainer.css("top", pos + "px");
         } else {
           clonedTableVisibleContainer.css("top", $pluginElement.offset().top + "px");
         }

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

@@ -2248,13 +2248,14 @@ ${ hueIcons.symbols() }
           lockSelectedRow: true,
           includeNavigator: false,
           mainScrollable: '.right-panel',
-          stickToTopPosition: vm.isPlayerMode() ? 1 : 73,
+          stickToTopPosition: function() { return vm.isPlayerMode() ? 1 : 73 },
           parentId: 'snippet_' + snippet.id(),
           clonedContainerPosition: "fixed"
         });
       }
       $(el).jHueHorizontalScrollbar();
-    } else {
+    }
+    else {
       $(el).parents(".dataTables_wrapper").jHueTableScroller({
         maxHeight: DATATABLES_MAX_HEIGHT,
         heightAfterCorrection: 0,
@@ -2778,6 +2779,9 @@ ${ hueIcons.symbols() }
                 clonedContainerPosition: "absolute"
               });
             }
+            else {
+              $('.right-panel').trigger('scroll');
+            }
           }
         });
       }
@@ -3031,6 +3035,7 @@ ${ hueIcons.symbols() }
           } else {
             $(".main-content").css("top", "1px");
           }
+          redrawFixedHeaders(200);
           $(window).bind("keydown", "esc", exitPlayerMode);
         } else {
           viewModel.isLeftPanelVisible(wasAssistVisible);