mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-13 17:35:46 +01:00
refactor: var to const and let (#9885)
* refactor: var to const and let * fix: missed global bootbox usage * refactor: align with eslint expectations
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
|
||||
define('forum/categories', ['components', 'categorySelector', 'hooks'], function (components, categorySelector, hooks) {
|
||||
var categories = {};
|
||||
const categories = {};
|
||||
|
||||
$(window).on('action:ajaxify.start', function (ev, data) {
|
||||
if (ajaxify.currentPage !== data.url) {
|
||||
@@ -34,8 +34,8 @@ define('forum/categories', ['components', 'categorySelector', 'hooks'], function
|
||||
};
|
||||
|
||||
function renderNewPost(cid, post) {
|
||||
var category = components.get('categories/category', 'cid', cid);
|
||||
var numRecentReplies = category.attr('data-numRecentReplies');
|
||||
const category = components.get('categories/category', 'cid', cid);
|
||||
const numRecentReplies = category.attr('data-numRecentReplies');
|
||||
if (!numRecentReplies || !parseInt(numRecentReplies, 10)) {
|
||||
return;
|
||||
}
|
||||
@@ -43,7 +43,7 @@ define('forum/categories', ['components', 'categorySelector', 'hooks'], function
|
||||
return;
|
||||
}
|
||||
|
||||
var recentPosts = category.find('[component="category/posts"]');
|
||||
const recentPosts = category.find('[component="category/posts"]');
|
||||
|
||||
app.parseAndTranslate('partials/categories/lastpost', 'posts', { posts: [post] }, function (html) {
|
||||
html.find('.post-content img:not(.not-responsive)').addClass('img-responsive');
|
||||
|
||||
Reference in New Issue
Block a user