mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-27 17:11:14 +01:00
fix: topic selection in merge
if merge was started from inside the topic
This commit is contained in:
@@ -66,11 +66,7 @@ define('forum/topic/merge', ['search', 'alerts', 'api'], function (search, alert
|
|||||||
callback = callback || function () {};
|
callback = callback || function () {};
|
||||||
api.get(`/topics/${tid}`, {}).then(function (topicData) {
|
api.get(`/topics/${tid}`, {}).then(function (topicData) {
|
||||||
const title = topicData ? topicData.title : 'No title';
|
const title = topicData ? topicData.title : 'No title';
|
||||||
if (selectedTids[tid]) {
|
selectedTids[tid] = title;
|
||||||
delete selectedTids[tid];
|
|
||||||
} else {
|
|
||||||
selectedTids[tid] = title;
|
|
||||||
}
|
|
||||||
checkButtonEnable();
|
checkButtonEnable();
|
||||||
showTopicsSelected();
|
showTopicsSelected();
|
||||||
callback();
|
callback();
|
||||||
@@ -89,8 +85,14 @@ define('forum/topic/merge', ['search', 'alerts', 'api'], function (search, alert
|
|||||||
if (!modal) {
|
if (!modal) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const tid = $(this).parents('[component="category/topic"]').attr('data-tid');
|
const topicEl = $(this).parents('[component="category/topic"]');
|
||||||
Merge.addTopic(tid);
|
const isSelected = topicEl.hasClass('selected');
|
||||||
|
const tid = topicEl.attr('data-tid');
|
||||||
|
if (isSelected) {
|
||||||
|
Merge.addTopic(tid);
|
||||||
|
} else {
|
||||||
|
Merge.removeTopic(tid);
|
||||||
|
}
|
||||||
|
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
|
|||||||
Reference in New Issue
Block a user