mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 11:35:55 +01:00
only send noscript paginator data on cold loads
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user