From e1283f9272cdd85f93d74626ab1ac9bbe31f8f00 Mon Sep 17 00:00:00 2001 From: Jota Teles Date: Tue, 6 Dec 2016 22:09:06 -0200 Subject: [PATCH] [#90] Torna o infinite scroll da home opcional --- .../frontpress-provider/models/frontpress.model.js | 9 ++++++++- .../views/home/controllers/home-directive.controller.js | 1 + src/js/views/home/templates/home.template.html | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/js/components/frontpress-provider/models/frontpress.model.js b/src/js/components/frontpress-provider/models/frontpress.model.js index 121da06..b13547c 100644 --- a/src/js/components/frontpress-provider/models/frontpress.model.js +++ b/src/js/components/frontpress-provider/models/frontpress.model.js @@ -14,6 +14,7 @@ function FrontPressProvider(FrontPressConfigurationFile, $disqusProvider){ setTemplateUrl: setTemplateUrl, setRoutes: setRoutes, setTitles: setTitles, + setInfiniteScroll: setInfiniteScroll, templateUrl: null, routes: null, titles: null, @@ -53,6 +54,10 @@ function FrontPressProvider(FrontPressConfigurationFile, $disqusProvider){ configure.siteName = siteName; } + function setInfiniteScroll(infiniteScroll){ + configure.infiniteScroll = infiniteScroll; + } + function loadRoutes(){ if(FrontPressConfigurationFile["routes"]){ @@ -90,7 +95,8 @@ function FrontPressProvider(FrontPressConfigurationFile, $disqusProvider){ apiVersion: configure.setApiVersion, templateUrl: configure.setTemplateUrl, routes: configure.setRoutes, - titles: configure.setTitles + titles: configure.setTitles, + infiniteScroll: configure.setInfiniteScroll }; for(var config in configsToFunctions){ @@ -181,6 +187,7 @@ function FrontPressProvider(FrontPressConfigurationFile, $disqusProvider){ routes: configure.routes, titles: configure.titles, siteName: configure.siteName, + infiniteScroll: configure.infiniteScroll, getTemplateUrl: getTemplateUrl, }; diff --git a/src/js/views/home/controllers/home-directive.controller.js b/src/js/views/home/controllers/home-directive.controller.js index 0d7c8de..3e87649 100644 --- a/src/js/views/home/controllers/home-directive.controller.js +++ b/src/js/views/home/controllers/home-directive.controller.js @@ -5,6 +5,7 @@ function HomeDirectiveController($stateParams, ListPostsModel, $state, $FrontPre vc.vm = ListPostsModel; var firstNextPageNumber = 2; vc.loadMorePostsAndPaginate = loadMorePostsAndPaginate; + vc.isInfiniteScrollDisabled = !$FrontPress.infiniteScroll; PageHeadModel.init(); var params = { diff --git a/src/js/views/home/templates/home.template.html b/src/js/views/home/templates/home.template.html index b27b3e1..c7c0377 100644 --- a/src/js/views/home/templates/home.template.html +++ b/src/js/views/home/templates/home.template.html @@ -1,5 +1,5 @@
-
+
Carregando posts novos ...