Просмотр исходного кода

[core] Tune the increment and limit for foreachVisible

This makes it render a bit more often but with fewer elements which leads to smoother scrolling on my setup.
Johan Ahlen 9 лет назад
Родитель
Сommit
016c9a7
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      desktop/core/src/desktop/static/desktop/js/ko.hue-bindings.js

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

@@ -3085,8 +3085,8 @@
         var newEntryCount = Math.ceil(Math.min($(window).innerHeight(), $container.innerHeight()) / entryMinHeight);
         if (newEntryCount !== visibleEntryCount) {
           var diff = newEntryCount - visibleEntryCount;
-          elementIncrement = options.elementIncrement || (newEntryCount * 4);
-          incrementLimit = options.incrementLimit || (newEntryCount * 2);
+          elementIncrement = options.elementIncrement || 25;
+          incrementLimit = options.incrementLimit || 5;
           visibleEntryCount = newEntryCount;
           endIndex += diff;
           huePubSub.publish('foreach.visible.update', id);