Bläddra i källkod

HUE-5904 [assist] Use nicescroll in the search autocomplete dropdown

Johan Ahlen 8 år sedan
förälder
incheckning
72fc994bb2

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

@@ -130,10 +130,15 @@
             }
           },
           _renderMenu: function (ul, items) {
+            var self = this;
             if (options.limitWidthToInput) {
               ul.css('max-width', Math.max(options.minWidth, $element.outerWidth(true)) + 'px');
             }
-            var self = this;
+
+            if (!ul.hasClass('nicescrollified')) {
+              ko.bindingHandlers.niceScroll.init(ul[0], function () {});
+            }
+
             ul.addClass(this.options.classPrefix + 'autocomplete');
             $.each(items, function (index, item) {
               self._renderItemData(ul, item);

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

@@ -44,7 +44,7 @@ from notebook.conf import ENABLE_QUERY_BUILDER
 
   <script type="text/html" id="nav-search-autocomp-no-match">
     <div class="nav-autocomplete-item-link" style="height: 30px;">
-      <div class="nav-autocomplete-empty">${ _('No recent match found') }</div class>
+      <div class="nav-autocomplete-empty">${ _('No recent match found') }</div>
     </div>
   </script>