Browse Source

[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 years ago
parent
commit
016c9a7c13
1 changed files with 2 additions and 2 deletions
  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);