diff --git a/public/src/forum/admin/index.js b/public/src/forum/admin/index.js index fada97e28e..ba45405cf6 100644 --- a/public/src/forum/admin/index.js +++ b/public/src/forum/admin/index.js @@ -18,19 +18,26 @@ define(function() { }; Admin.updateRoomUsage = function(err, data) { - console.log(arguments); - var active_users = document.getElementById('active_users'), + var active_users = $('#active_users'), total = 0; - active_users.innerHTML = ''; + + if(!active_users.length) { + return; + } + + active_users.html(''); + + var usersHtml = ''; for (var room in data) { if (room !== '') { var count = $(data[room]).length; total += count; - active_users.innerHTML = active_users.innerHTML + "
" + room + " " + count + " active user" + (count > 1 ? "s" : "") + "
"; + usersHtml += "
" + room + " " + count + " active user" + (count > 1 ? "s" : "") + "
"; } } + active_users.html(usersHtml); document.getElementById('connections').innerHTML = total; }; diff --git a/public/src/forum/topic.js b/public/src/forum/topic.js index 46775716ce..e9d7f814cd 100644 --- a/public/src/forum/topic.js +++ b/public/src/forum/topic.js @@ -686,22 +686,21 @@ define(['composer'], function(composer) { }); socket.on('event:post_edited', function(data) { - var editedPostEl = document.getElementById('content_' + data.pid); + var editedPostEl = $('#content_' + data.pid), + editedPostTitle = $('#topic_title_' + data.pid); - var editedPostTitle = $('#topic_title_' + data.pid); - - if (editedPostTitle.length > 0) { + if (editedPostTitle.length) { editedPostTitle.fadeOut(250, function() { editedPostTitle.html(data.title); editedPostTitle.fadeIn(250); }); } - $(editedPostEl).fadeOut(250, function() { - this.innerHTML = data.content; - $(this).fadeIn(250); + editedPostEl.fadeOut(250, function() { + editedPostEl.html(data.content); + editedPostEl.find('img').addClass('img-responsive'); + editedPostEl.fadeIn(250); }); - }); socket.on('posts.favourite', function(data) {