Browse Source

[core] Make the foreachVisible limits adjustable with parameters

Johan Ahlen 9 năm trước cách đây
mục cha
commit
24e667d

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

@@ -2951,8 +2951,8 @@
       var elementIncrement = 0; // Elements to add on either side of the visible elements, set to 3x visibleCount
       var updateVisibleEntryCount = function () {
         visibleEntryCount = Math.ceil($container.innerHeight() / entryMinHeight);
-        elementIncrement = visibleEntryCount * 3;
-        incrementLimit = visibleEntryCount / 3;
+        elementIncrement = options.elementIncrement || (visibleEntryCount * 3);
+        incrementLimit = options.incrementLimit || visibleEntryCount;
       };
       var updateCountInterval = setInterval(updateVisibleEntryCount, 100);
       updateVisibleEntryCount();