浏览代码

HUE-5918 [assist] Fix issue with initial autocompletion of assist search

Johan Ahlen 8 年之前
父节点
当前提交
7f31c16d8f
共有 1 个文件被更改,包括 2 次插入4 次删除
  1. 2 4
      desktop/core/src/desktop/static/desktop/js/ko.hue-bindings.js

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

@@ -137,10 +137,6 @@
               ul.css('max-width', Math.max(options.minWidth, $element.outerWidth(true)) + 'px');
             }
 
-            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);
@@ -228,6 +224,8 @@
       }
 
       $element.hueAutocomplete(options);
+      
+      ko.bindingHandlers.niceScroll.init($element.data('custom-hueAutocomplete').menu.element, function () {});
 
       // IE 11 trick to prevent it from being shown on page refresh
       window.setTimeout(function () {