Преглед на файлове

HUE-5003 [core] Prevent JS error on calling scroll to column on just initialized HueDataTables

Enrico Berti преди 9 години
родител
ревизия
8a8ba491fd
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      desktop/core/src/desktop/static/desktop/js/jquery.huedatatable.js

+ 1 - 1
desktop/core/src/desktop/static/desktop/js/jquery.huedatatable.js

@@ -513,7 +513,7 @@
           self.$table.data('isScrollAttached', true);
           var scrollFn = function () {
             window.clearTimeout(drawTimeout);
-            drawTimeout = window.setTimeout(self.fnDraw, Math.max(100, Math.min(self.$table.data('aoColumns').length, 500)));
+            drawTimeout = window.setTimeout(self.fnDraw, Math.max(100, Math.min(self.$table.data('aoColumns') ? self.$table.data('aoColumns').length : 500, 500)));
           }
           self.$table.parents(oInit['scrollable']).data('scrollFnDt', scrollFn);
           self.$table.parents(oInit['scrollable']).on('scroll', scrollFn);