only send noscript paginator data on cold loads

This commit is contained in:
psychobunny
2014-09-20 15:04:14 -04:00
parent f891f49339
commit a52c69d2a1
2 changed files with 18 additions and 14 deletions

View File

@@ -202,6 +202,7 @@ categoriesController.get = function(req, res, next) {
data['feeds:disableRSS'] = parseInt(meta.config['feeds:disableRSS'], 10) === 1;
data.csrf = req.csrfToken();
if (!res.locals.isAPI) {
// Paginator for noscript
data.pages = [];
for(var x=1;x<=data.pageCount;x++) {
@@ -210,6 +211,7 @@ categoriesController.get = function(req, res, next) {
active: x === parseInt(page, 10)
});
}
}
res.render('category', data);
});

View File

@@ -217,6 +217,7 @@ topicsController.get = function(req, res, next) {
topic_url += '?' + queryString;
}
if (!res.locals.isAPI) {
// Paginator for noscript
data.pages = [];
for(var x=1; x<=data.pageCount; x++) {
@@ -225,6 +226,7 @@ topicsController.get = function(req, res, next) {
active: x === parseInt(page, 10)
});
}
}
res.render('topic', data);
});