Browse Source

HUE-8184 [dashboard] The search bar should be fixed on top

Enrico Berti 7 years ago
parent
commit
8f9be33c6e

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

@@ -6324,7 +6324,7 @@
 
 
       var initialTopPosition = -1;
       var initialTopPosition = -1;
       var initialSize = {
       var initialSize = {
-        w: $(element).width(),
+        w: $(element).width() - hueUtils.scrollbarWidth(),
         h: $(element).outerHeight() + (options.jumpCorrection || 0)
         h: $(element).outerHeight() + (options.jumpCorrection || 0)
       };
       };
 
 
@@ -6368,7 +6368,7 @@
       function resetInitialStyle() {
       function resetInitialStyle() {
         $(element).removeAttr('style');
         $(element).removeAttr('style');
         initialSize = {
         initialSize = {
-          w: $(element).width(),
+          w: $(element).width() - hueUtils.scrollbarWidth(),
           h: $(element).outerHeight() + (options.jumpCorrection || 0)
           h: $(element).outerHeight() + (options.jumpCorrection || 0)
         };
         };
         dock();
         dock();

+ 1 - 1
desktop/core/src/desktop/templates/common_dashboard.mako

@@ -82,7 +82,7 @@
   %endif
   %endif
 
 
   <!-- ko if: columns().length > 0 && isToolbarVisible -->
   <!-- ko if: columns().length > 0 && isToolbarVisible -->
-  <div data-bind="dockable: { scrollable: '.page-content', jumpCorrection: 50, topSnap: '${ conf.CUSTOM.BANNER_TOP_HTML.get() and "78px" or "50px" }', triggerAdjust: 0 }">
+  <div data-bind="dockable: { scrollable: '.page-content', jumpCorrection: 50, topSnap: '${ conf.CUSTOM.BANNER_TOP_HTML.get() and "128px" or "100px" }', triggerAdjust: 50 }">
     %if hasattr(caller, "results"):
     %if hasattr(caller, "results"):
     <div style="float: left; margin-left: 20px">
     <div style="float: left; margin-left: 20px">
       <div class="toolbar-label">${_('DISPLAY')}</div>
       <div class="toolbar-label">${_('DISPLAY')}</div>

+ 1 - 1
desktop/libs/dashboard/src/dashboard/templates/common_search.mako

@@ -51,7 +51,7 @@ from dashboard.conf import USE_GRIDSTER, HAS_REPORT_ENABLED, HAS_WIDGET_FILTER,
     </div>
     </div>
   </form>
   </form>
 %else:
 %else:
-<div class="search-bar" data-bind="visible: ! $root.isPlayerMode()">
+<div class="search-bar" data-bind="visible: !$root.isPlayerMode(), dockable: { scrollable: '.page-content', jumpCorrection: 0, topSnap: '${ conf.CUSTOM.BANNER_TOP_HTML.get() and "78px" or "50px" }', triggerAdjust: 50 }">
   <div class="search-bar-header">
   <div class="search-bar-header">
     <div class="search-bar-logo">
     <div class="search-bar-logo">
       <div class="app-header">
       <div class="app-header">