diff --git a/Classes/Controller/ListByCategoryController.php b/Classes/Controller/ListByCategoryController.php index 9484b784dd04119d4a6cc439a3f88a99f6d20328..80acdb1e90a894075cf8620e176c0114bdb1042b 100644 --- a/Classes/Controller/ListByCategoryController.php +++ b/Classes/Controller/ListByCategoryController.php @@ -68,15 +68,19 @@ class ListByCategoryController extends AbstractController { /** @noinspection PhpUndefinedMethodInspection */ $newsCount = $this->newsRepository->countByPid($selectedCategoryId); - $news = $this->newsRepository->findAllSortedNewsByCategory($selectedCategoryId, $newsPerPage, $offset); - $highlightedNews = $this->newsRepository->findLastUpdatedOrHighlightedNewsByCategory( - 1, FALSE, $selectedCategoryId - )->getFirst(); $numberOfPages = ceil($newsCount / $newsPerPage); - + $news = $this->newsRepository->findAllSortedNewsByCategory($selectedCategoryId, $newsPerPage, $offset); $news = $news->toArray(); - if ($highlightedNews && !in_array($highlightedNews, $news)) { - $news[] = $highlightedNews; + + $highlightedNews = NULL; + if ($currentPageBrowserPage <= 1) { + $highlightedNews = $this->newsRepository->findLastUpdatedOrHighlightedNewsByCategory( + 1, FALSE, $selectedCategoryId + )->getFirst(); + + if ($highlightedNews && !in_array($highlightedNews, $news)) { + $news[] = $highlightedNews; + } } $newsMetaData = $highlightedNewsMetaData = []; diff --git a/Resources/Public/Scripts/ScrollBrowser.js b/Resources/Public/Scripts/ScrollBrowser.js index ae7fb0ccd971043a933c2966c5124b655deb697d..f574fad7c30a1ce8860c4834882d611351f99463 100644 --- a/Resources/Public/Scripts/ScrollBrowser.js +++ b/Resources/Public/Scripts/ScrollBrowser.js @@ -96,11 +96,7 @@ SG.ElementScrollBrowser.prototype = { this.lastUrl = this.url; this.url = $(response).find('.tx-pagebrowse-next a').attr('href'); //resultList.find('.tx-sgnews-load-indicator').remove(); - - $(results[0]).hide(); resultList.append(results); - resultList.find('.tx-sgnews-latest:last').remove(); - this.loadIndicator = resultList.children(':last'); this.lock = false; }