mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-05-19 05:44:39 -04:00
Load $nb/2 articles when articles are unfolded
See https://github.com/marienfressinaud/FreshRSS/issues/559
This commit is contained in:
@@ -83,6 +83,11 @@ class FreshRSS_index_Controller extends Minz_ActionController {
|
||||
$nb = Minz_Request::param ('nb', $this->view->conf->posts_per_page);
|
||||
$first = Minz_Request::param ('next', '');
|
||||
|
||||
$ajax_request = Minz_Request::param('ajax', false);
|
||||
if ($ajax_request == 1 && $this->view->conf->display_posts) {
|
||||
$nb = max(1, round($nb / 2));
|
||||
}
|
||||
|
||||
if ($this->view->state === FreshRSS_Entry::STATE_NOT_READ) { //Any unread article in this category at all?
|
||||
switch ($getType) {
|
||||
case 'a':
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
if (!empty($this->nextId)) {
|
||||
$params = Minz_Request::params();
|
||||
$params['next'] = $this->nextId;
|
||||
$params['ajax'] = 1;
|
||||
?>
|
||||
<link id="prefetch" rel="next prefetch" href="<?php echo Minz_Url::display(array('c' => Minz_Request::controllerName(), 'a' => Minz_Request::actionName(), 'params' => $params)); ?>" />
|
||||
<?php } ?>
|
||||
|
||||
@@ -9,7 +9,10 @@
|
||||
<ul class="pagination">
|
||||
<li class="item pager-next">
|
||||
<?php if (!empty($this->nextId)) { ?>
|
||||
<?php $params['next'] = $this->nextId; ?>
|
||||
<?php
|
||||
$params['next'] = $this->nextId;
|
||||
$params['ajax'] = 1;
|
||||
?>
|
||||
<a id="load_more" href="<?php echo Minz_Url::display(array('c' => $c, 'a' => $a, 'params' => $params)); ?>">
|
||||
<?php echo _t('load_more'); ?>
|
||||
</a>
|
||||
|
||||
Reference in New Issue
Block a user