diff --git a/public/src/forum/topic.js b/public/src/forum/topic.js index 7203bf41d6..bd4a46a143 100644 --- a/public/src/forum/topic.js +++ b/public/src/forum/topic.js @@ -496,23 +496,23 @@ function set_delete_state(deleted) { var deleteThreadEl = document.getElementById('delete_thread'), deleteTextEl = deleteThreadEl.getElementsByTagName('span')[0], - threadEl = document.querySelector('#post-container'), + threadEl = $('#post-container'), deleteNotice = document.getElementById('thread-deleted') || document.createElement('div'); if (deleted) { deleteTextEl.innerHTML = ' Restore Thread'; - $(threadEl).addClass('deleted'); + threadEl.addClass('deleted'); // Spawn a 'deleted' notice at the top of the page deleteNotice.setAttribute('id', 'thread-deleted'); - deleteNotice.className = 'alert'; + deleteNotice.className = 'alert alert-warning'; deleteNotice.innerHTML = 'This thread has been deleted. Only users with thread management privileges can see it.'; - document.getElementById('content').insertBefore(deleteNotice, threadEl); + threadEl.before(deleteNotice); thread_state.deleted = '1'; } else { deleteTextEl.innerHTML = ' Delete Thread'; - $(threadEl).removeClass('deleted'); + threadEl.removeClass('deleted'); deleteNotice.parentNode.removeChild(deleteNotice); thread_state.deleted = '0';