feat(topic-events): client-side handling on topic event log

This commit is contained in:
Julian Lam
2021-01-12 11:52:55 -05:00
parent df2fdd56ba
commit 8e93bf7362
2 changed files with 13 additions and 4 deletions

View File

@@ -5,8 +5,9 @@ define('forum/topic/threadTools', [
'components',
'translator',
'handleBack',
'forum/topic/posts',
'api',
], function (components, translator, handleBack, api) {
], function (components, translator, handleBack, posts, api) {
var ThreadTools = {};
ThreadTools.init = function (tid, topicContainer) {
@@ -271,6 +272,8 @@ define('forum/topic/threadTools', [
$('.topic-header [component="topic/locked"]').toggleClass('hidden', !data.isLocked);
$('[component="post/tools"] .dropdown-menu').html('');
ajaxify.data.locked = data.isLocked;
posts.addTopicEvents(data.events);
};
ThreadTools.setDeleteState = function (data) {
@@ -302,6 +305,8 @@ define('forum/topic/threadTools', [
threadEl.toggleClass('deleted', data.isDelete);
ajaxify.data.deleted = data.isDelete ? 1 : 0;
posts.addTopicEvents(data.events);
};
@@ -322,6 +327,8 @@ define('forum/topic/threadTools', [
);
}
ajaxify.data.pinned = data.pinned;
posts.addTopicEvents(data.events);
};
function setFollowState(state) {