Explorar o código

HUE-5817 [editor] Bigger/easier result grid horizontal scrolling

This harmonizes also the colors of the scrollbars/rails for NiceScroll, fixes the sizing problem of the horizontal scrollbar
Enrico Berti %!s(int64=8) %!d(string=hai) anos
pai
achega
0fb3cbf

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
desktop/core/src/desktop/static/desktop/css/hue.css


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
desktop/core/src/desktop/static/desktop/css/hue3-extra.css


+ 19 - 0
desktop/core/src/desktop/static/desktop/js/hue.utils.js

@@ -344,6 +344,25 @@ if (!('addRule' in CSSStyleSheet.prototype)) {
     }
   };
 
+  hueUtils.initNiceScroll = function ($el, options) {
+    var defaults = {
+      cursorcolor: "#7D7D7D",
+      cursorborder: "1px solid #7D7D7D",
+      background: "#F4F4F4",
+      cursoropacitymin: 0.38,
+      cursoropacitymax: 1,
+      mousescrollstep: 60,
+      cursorwidth: "6px",
+      railpadding: { top: 1, right: 1, left: 1, bottom: 1 },
+      hidecursordelay: 0,
+      scrollspeed: 1,
+      cursorminheight: 20,
+      horizrailenabled: true,
+      autohidemode: "cursor"
+    }
+    return $el.niceScroll($.extend(defaults, options || {}));
+  };
+
 }(hueUtils = window.hueUtils || {}));
 
 if (!Object.keys) {

+ 1 - 12
desktop/core/src/desktop/static/desktop/js/jquery.filechooser.js

@@ -367,18 +367,7 @@
         $('<div>').addClass('clearfix').appendTo($(_parent.element).find('.filechooser-tree'));
 
         if (typeof $.nicescroll !== 'undefined') {
-          $scrollingBreadcrumbs.niceScroll({
-            cursorcolor: "#C1C1C1",
-            cursorborder: "1px solid #C1C1C1",
-            cursoropacitymin: 0,
-            cursoropacitymax: 1,
-            scrollspeed: 100,
-            mousescrollstep: 60,
-            railhoffset: {
-              top: 2
-            },
-            autohidemode: "leave"
-          });
+          hueUtils.initNiceScroll($scrollingBreadcrumbs, {railhoffset: {top: 2}});
           $scrollingBreadcrumbs.parents('.modal').find('.nicescroll-rails-vr').remove();
         }
 

+ 2 - 2
desktop/core/src/desktop/static/desktop/js/jquery.horizontalscrollbar.js

@@ -33,7 +33,7 @@
 
   function initWhenReady(el) {
     if ($(el).parents('.dataTables_wrapper').length > 0) {
-      var colWidth = $(el).find('thead tr th').width() + 5;
+      var colWidth = $(el).find('thead tr th').outerWidth();
       if ($(el).parents('.dataTables_wrapper').find('.hue-scrollbar-x-rail').length == 0 && $(el).parents('.dataTables_wrapper').width() < $(el).parents('.dataTables_wrapper')[0].scrollWidth) {
         $('.hue-scrollbar-x-rail').remove();
         var scrollbarRail = $('<div>');
@@ -78,7 +78,7 @@
         scrollbarRail.width($(el).parents(".dataTables_wrapper").width() - colWidth);
         scrollbarRail.css("marginLeft", (colWidth) + "px");
         if (scrollbarRail.position().top > $(window).height() - 10) {
-          scrollbarRail.css('bottom', '3px');
+          scrollbarRail.css('bottom', '0');
         }
         $(el).parents('.dataTables_wrapper').bind('scroll_update', function () {
           scrollbar.css("left", ((scrollbarRail.width() - scrollbar.width()) * ($(el).parents('.dataTables_wrapper').scrollLeft() / ($(el).parents('.dataTables_wrapper')[0].scrollWidth - $(el).parents('.dataTables_wrapper').width()))) + "px");

+ 1 - 7
desktop/core/src/desktop/static/desktop/js/jquery.notify.js

@@ -76,18 +76,12 @@
       }
       el.find(".message").html("<strong>" + _this.options.message + "</strong>");
 
-      el.find(".message").niceScroll({
+      hueUtils.initNiceScroll(el.find(".message"), {
         cursorcolor: scrollColor,
         cursorborder: '1px solid ' + scrollColor,
-        cursoropacitymin: 0,
-        cursoropacitymax: 0.7,
-        scrollspeed: 100,
-        mousescrollstep: 60,
-        cursorminheight: 20,
         horizrailenabled: false,
         zindex: 14000,
         railoffset: {left: 5},
-        autohidemode: 'leave'
       });
 
       if (_this.options.css != null) {

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

@@ -4413,16 +4413,8 @@
         }).appendTo($wrapper);
 
         if ($.fn.niceScroll && withNiceScroll) {
-          $container.niceScroll({
-            cursorcolor: "#C1C1C1",
-            cursorborder: "1px solid #C1C1C1",
-            cursoropacitymin: 0,
-            cursoropacitymax: 1,
-            scrollspeed: 1,
-            mousescrollstep: 60,
-            cursorminheight: options.cursorminheight || 20,
-            horizrailenabled: options.horizrailenabled || false,
-            autohidemode: "leave"
+          hueUtils.initNiceScroll($container, {
+            horizrailenabled: false
           });
         }
       } else {
@@ -4802,17 +4794,7 @@
     init: function (element, valueAccessor, allBindings) {
       var options = valueAccessor() || {};
       if ((typeof options.enable === 'undefined' || options.enable) && $.fn.niceScroll) {
-        var niceScroll = $(element).niceScroll({
-          cursorcolor: "#C1C1C1",
-          cursorborder: "1px solid #C1C1C1",
-          cursoropacitymin: 0,
-          cursoropacitymax: 1,
-          mousescrollstep: 60,
-          scrollspeed: 1,
-          cursorminheight: options.cursorminheight || 20,
-          horizrailenabled: typeof options.horizrailenabled !== 'undefined' ? options.horizrailenabled : true,
-          autohidemode: "leave"
-        });
+        var niceScroll = hueUtils.initNiceScroll($(element), options);
         $(element).addClass('nicescrollified');
         ko.utils.domNodeDisposal.addDisposeCallback(element, niceScroll.remove);
       }

+ 18 - 25
desktop/core/src/desktop/static/desktop/less/components/hue-scrollbar.less

@@ -21,31 +21,24 @@
 }
 
 .hue-scrollbar-x-rail {
-  opacity: 0.2;
   position: fixed;
   z-index: 10000;
-  -webkit-border-radius: 5px;
-  -moz-border-radius: 5px;
-  border-radius: 5px;
-  -webkit-transition: background-color .2s linear, opacity .2s linear;
-  -moz-transition: background-color .2s linear, opacity .2s linear;
-  -o-transition: background-color .2s linear, opacity .2s linear;
-  transition: background-color .2s linear, opacity .2s linear;
-  height: 9px;
-}
-
-
-.hue-scrollbar-x-rail > .hue-scrollbar-x {
-  position: absolute;
-  background-color: #C1C1C1;
-  -webkit-border-radius: 5px;
-  -moz-border-radius: 5px;
-  border-radius: 5px;
-  -webkit-transition: background-color .2s linear;
-  -moz-transition: background-color .2s linear;
-  -o-transition: background-color .2s linear;
-  transition: background-color .2s linear;
-  bottom: 1px;
-  height: 9px;
-  z-index: 10000;
+  padding: 2px;
+  background-color: #F4F4F4;
+  border: 1px solid #F0F0F0;
+  &>.hue-scrollbar-x {
+    position: absolute;
+    background-color: #C1C1C1;
+    -webkit-border-radius: 5px;
+    -moz-border-radius: 5px;
+    border-radius: 5px;
+    .hue-linear-transition(background-color);
+    height: 8px;
+    z-index: 10000;
+  }
+  &:hover {
+    &>.hue-scrollbar-x {
+      background-color: #7D7D7D;
+    }
+  }
 }

+ 0 - 1
desktop/core/src/desktop/static/desktop/less/hue-assist.less

@@ -185,7 +185,6 @@
 .assist-inner-panel {
   position: absolute;
   overflow: hidden;
-  padding-right: 3px;
   top: 10px;
   right: 0;
   bottom: 2px;

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

@@ -353,7 +353,7 @@ ${ hueIcons.symbols() }
       onPosition: function() { huePubSub.publish('split.draggable.position') }
     }"><div class="resize-bar" style="right: 0">&nbsp;</div></div>
 
-    <div class="right-panel" data-bind="css: { 'side-panel-closed': !rightAssistVisible() || !rightAssistAvailable() }, visibleOnHover: { selector: '.hide-right-side-panel' }">
+    <div class="right-panel side-panel-closed" data-bind="css: { 'side-panel-closed': !rightAssistVisible() || !rightAssistAvailable() }, visibleOnHover: { selector: '.hide-right-side-panel' }">
       <a href="javascript:void(0);" style="display: none;" title="${_('Show Assist')}" class="pointer side-panel-toggle show-right-side-panel" data-bind="visible: ! rightAssistVisible() && rightAssistAvailable(), toggle: rightAssistVisible"><i class="fa fa-chevron-left"></i></a>
       <a href="javascript:void(0);" style="display: none; opacity: 0;" title="${_('Hide Assist')}" class="pointer side-panel-toggle hide-right-side-panel" data-bind="visible: rightAssistVisible() && rightAssistAvailable(), toggle: rightAssistVisible"><i class="fa fa-chevron-right"></i></a>
 

+ 2 - 0
desktop/core/src/desktop/templates/sql_context_popover.mako

@@ -692,6 +692,8 @@ from metadata.conf import has_navigator
             }
           });
 
+          hueUtils.initNiceScroll($t.parents('.dataTables_wrapper'));
+
           $t.parents('.dataTables_wrapper').niceScroll({
             cursorcolor: "#C1C1C1",
             cursorborder: "1px solid #C1C1C1",

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio