mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 05:55:48 +01:00
fix: topic labels on topics_list
This commit is contained in:
@@ -17,6 +17,10 @@ define('forum/category/tools', [
|
|||||||
|
|
||||||
handlePinnedTopicSort();
|
handlePinnedTopicSort();
|
||||||
|
|
||||||
|
$('[component="category/topic"]').each((index, el) => {
|
||||||
|
threadTools.observeTopicLabels($(el).find('[component="topic/labels"]'));
|
||||||
|
});
|
||||||
|
|
||||||
components.get('topic/delete').on('click', function () {
|
components.get('topic/delete').on('click', function () {
|
||||||
categoryCommand('del', '/state', 'delete', onDeletePurgeComplete);
|
categoryCommand('del', '/state', 'delete', onDeletePurgeComplete);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ define('forum/topic/threadTools', [
|
|||||||
animation: false,
|
animation: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
observeTopicLabels();
|
ThreadTools.observeTopicLabels($('[component="topic/labels"]'));
|
||||||
|
|
||||||
// function topicCommand(method, path, command, onComplete) {
|
// function topicCommand(method, path, command, onComplete) {
|
||||||
topicContainer.on('click', '[component="topic/delete"]', function () {
|
topicContainer.on('click', '[component="topic/delete"]', function () {
|
||||||
@@ -188,9 +188,8 @@ define('forum/topic/threadTools', [
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function observeTopicLabels() {
|
ThreadTools.observeTopicLabels = function (labels) {
|
||||||
// show or hide topic/labels container depending on children visibility
|
// show or hide topic/labels container depending on children visibility
|
||||||
const labels = $('[component="topic/labels"]');
|
|
||||||
const mut = new MutationObserver(function (mutations) {
|
const mut = new MutationObserver(function (mutations) {
|
||||||
const first = mutations[0];
|
const first = mutations[0];
|
||||||
if (first && first.attributeName === 'class') {
|
if (first && first.attributeName === 'class') {
|
||||||
@@ -202,7 +201,7 @@ define('forum/topic/threadTools', [
|
|||||||
labels.children().each((index, el) => {
|
labels.children().each((index, el) => {
|
||||||
mut.observe(el, { attributes: true });
|
mut.observe(el, { attributes: true });
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
function renderMenu(container) {
|
function renderMenu(container) {
|
||||||
container = container.get(0);
|
container = container.get(0);
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ define('topicSelect', ['components'], function (components) {
|
|||||||
if (topicsContainer) {
|
if (topicsContainer) {
|
||||||
topicsContainer.find('[component="category/topic"].selected').removeClass('selected');
|
topicsContainer.find('[component="category/topic"].selected').removeClass('selected');
|
||||||
topicsContainer.find('[component="topic/select"]').toggleClass('fa-check-square-o', false).toggleClass('fa-square-o', true);
|
topicsContainer.find('[component="topic/select"]').toggleClass('fa-check-square-o', false).toggleClass('fa-square-o', true);
|
||||||
|
updateSelectedBadgeCount();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user