Skip to content

Commit ed3e4db

Browse files
committed
Infinite
1 parent 856ec32 commit ed3e4db

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

etc/adminhtml/system.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<field id="delay" translate="label comment" type="text" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
2121
<label>Delay (ms)</label>
2222
<comment><![CDATA[Delay value for scroll down. default: 600]]></comment>
23+
<validate>required-entry validate-digits validate-zero-or-greater</validate>
2324
</field>
2425
<field id="content" translate="label comment" type="text" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
2526
<label>Content</label>
@@ -54,6 +55,7 @@
5455
<field id="load_more" translate="label comment" type="text" sortOrder="70" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
5556
<label>Load More threshold</label>
5657
<comment><![CDATA[When this page number is reached, a button to load more products will be shown instead of continue loading products automatically with the scroll (this could be useful to help the user to reach the footer). TIP: use a high number to disable this feature.]]></comment>
58+
<validate>required-entry validate-digits</validate>
5759
</field>
5860
<field id="load_more_text" translate="label comment" type="text" sortOrder="80" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
5961
<label>Load More button text</label>

etc/config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<loading_image/>
1414
<loading_text><![CDATA[<em>Loading - please wait...</em>]]></loading_text>
1515
<done_text><![CDATA[<em>You've reached the end of the item.</em>]]></done_text>
16-
<load_more>3</load_more>
16+
<load_more>-1</load_more>
1717
<load_more_text>Load more</load_more_text>
1818
</general>
1919
</magepow_infinitescroll>

view/frontend/templates/infinitescroll.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ if ($loadingImage) {
5050
html: '<div class="ias-trigger ias-trigger-next"><button class="load-more"><?= $loadMoreText ?></button></div>',
5151
textPrev: "<?= $loadMoreText ?>",
5252
htmlPrev: '<div class="ias-trigger ias-trigger-prev"><button class="load-more"><?= $loadMoreText ?></button></div>',
53-
offset: "<?= $loadMore ?>",
53+
offset: <?php echo ($loadMore > 0) ? $loadMore: 'false' ?>,
5454
}));
5555
window.ias.on('rendered', function (items) {
5656
$('body').trigger('contentUpdated');

0 commit comments

Comments
 (0)