From 8ff70e20ef274475c7e4567993e699bc7341ce9e Mon Sep 17 00:00:00 2001 From: Fabian Galinski <fabian@sgalinski.de> Date: Wed, 22 Jul 2015 15:27:38 +0200 Subject: [PATCH] [TASK] Adds non pushed features --- .../Controller/ListByCategoryController.php | 18 +++++++++++------- Resources/Public/Scripts/ScrollBrowser.js | 4 ---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Classes/Controller/ListByCategoryController.php b/Classes/Controller/ListByCategoryController.php index 9484b78..80acdb1 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 ae7fb0c..f574fad 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; } -- GitLab