mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-23 17:00:24 +01:00
don't error if topicsContainer is not set
This commit is contained in:
@@ -39,6 +39,9 @@ define('topicSelect', ['components'], function (components) {
|
|||||||
|
|
||||||
TopicSelect.getSelectedTids = function () {
|
TopicSelect.getSelectedTids = function () {
|
||||||
var tids = [];
|
var tids = [];
|
||||||
|
if (!topicsContainer) {
|
||||||
|
return tids;
|
||||||
|
}
|
||||||
topicsContainer.find('[component="category/topic"].selected').each(function () {
|
topicsContainer.find('[component="category/topic"].selected').each(function () {
|
||||||
tids.push($(this).attr('data-tid'));
|
tids.push($(this).attr('data-tid'));
|
||||||
});
|
});
|
||||||
@@ -46,8 +49,10 @@ define('topicSelect', ['components'], function (components) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
TopicSelect.unselectAll = function () {
|
TopicSelect.unselectAll = function () {
|
||||||
|
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);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function selectRange(clickedTid) {
|
function selectRange(clickedTid) {
|
||||||
|
|||||||
Reference in New Issue
Block a user