mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 03:55:55 +01:00
only send noscript paginator data on cold loads
This commit is contained in:
@@ -202,13 +202,15 @@ categoriesController.get = function(req, res, next) {
|
|||||||
data['feeds:disableRSS'] = parseInt(meta.config['feeds:disableRSS'], 10) === 1;
|
data['feeds:disableRSS'] = parseInt(meta.config['feeds:disableRSS'], 10) === 1;
|
||||||
data.csrf = req.csrfToken();
|
data.csrf = req.csrfToken();
|
||||||
|
|
||||||
// Paginator for noscript
|
if (!res.locals.isAPI) {
|
||||||
data.pages = [];
|
// Paginator for noscript
|
||||||
for(var x=1;x<=data.pageCount;x++) {
|
data.pages = [];
|
||||||
data.pages.push({
|
for(var x=1;x<=data.pageCount;x++) {
|
||||||
page: x,
|
data.pages.push({
|
||||||
active: x === parseInt(page, 10)
|
page: x,
|
||||||
});
|
active: x === parseInt(page, 10)
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
res.render('category', data);
|
res.render('category', data);
|
||||||
|
|||||||
@@ -217,13 +217,15 @@ topicsController.get = function(req, res, next) {
|
|||||||
topic_url += '?' + queryString;
|
topic_url += '?' + queryString;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Paginator for noscript
|
if (!res.locals.isAPI) {
|
||||||
data.pages = [];
|
// Paginator for noscript
|
||||||
for(var x=1; x<=data.pageCount; x++) {
|
data.pages = [];
|
||||||
data.pages.push({
|
for(var x=1; x<=data.pageCount; x++) {
|
||||||
page: x,
|
data.pages.push({
|
||||||
active: x === parseInt(page, 10)
|
page: x,
|
||||||
});
|
active: x === parseInt(page, 10)
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
res.render('topic', data);
|
res.render('topic', data);
|
||||||
|
|||||||
Reference in New Issue
Block a user