feat: closes #9684, allow event deletion

fix: topic events appearing before necro messages
feat: add move topic event
feat: add ability to delete specific topic events via events.purge
This commit is contained in:
Barış Soner Uşaklı
2021-08-10 19:39:51 -04:00
parent 23dafa204c
commit 358ad74054
9 changed files with 124 additions and 31 deletions

View File

@@ -49,6 +49,17 @@ define('forum/topic/threadTools', [
return false;
});
topicContainer.on('click', '[component="topic/event/delete"]', function () {
const eventId = $(this).attr('data-topic-event-id');
const eventEl = $(this).parents('[component="topic/event"]');
api.del(`/topics/${tid}/events/${eventId}`, {})
.then(function () {
eventEl.remove();
})
.catch(app.alertError);
return false;
});
// todo: should also use topicCommand, but no write api call exists for this yet
topicContainer.on('click', '[component="topic/mark-unread"]', function () {
socket.emit('topics.markUnread', tid, function (err) {