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:
gasoved
2021-10-12 17:26:18 +03:00
committed by GitHub
parent eddb98681c
commit b0a24d6dd5
154 changed files with 1850 additions and 1854 deletions

View File

@@ -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');