diff --git a/public/src/app.js b/public/src/app.js index 9ad598be89..e33a0f545d 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -218,9 +218,10 @@ var socket, $('#' + params.location).prepend(alert.fadeIn('100')); if(typeof params.closefn === 'function') { - alert.find('button').on('click', function () { + alert.find('button').on('click', function() { params.closefn(); fadeOut(); + return false; }); } }); diff --git a/public/src/forum/admin/index.js b/public/src/forum/admin/index.js index 1870884328..7c9f6db3bd 100644 --- a/public/src/forum/admin/index.js +++ b/public/src/forum/admin/index.js @@ -35,6 +35,17 @@ define(function() { $('.restart').on('click', function() { socket.emit('admin.restart'); }); + + socket.emit('admin.getVisitorCount', function(err, data) { + if(err) { + return app.alertError(err.message); + } + + var uniqueVisitors = $('#unique-visitors'); + for(var key in data) { + uniqueVisitors.find('#' + key).text(data[key]); + } + }); }; Admin.updateRoomUsage = function(err, data) { diff --git a/public/src/forum/topic.js b/public/src/forum/topic.js index 84eafc8621..4ab60fe365 100644 --- a/public/src/forum/topic.js +++ b/public/src/forum/topic.js @@ -141,16 +141,16 @@ define(['composer', 'forum/pagination'], function(composer, pagination) { } loadingEl.remove(); - categoriesEl.on('click', function(e) { - var el = $(e.target); + categoriesEl.on('click', 'li[data-cid]', function(e) { + var el = $(this); if (el.is('li')) { - confirmCat.html(e.target.innerHTML); + confirmCat.html(el.html()); confirmDiv.css({display: 'block'}); targetCid = el.attr('data-cid'); - targetCatLabel = e.html(); + targetCatLabel = el.html(); commitEl.prop('disabled', false); } - }, false); + }); commitEl.on('click', function() { if (!commitEl.prop('disabled') && targetCid) { diff --git a/public/templates/admin/index.tpl b/public/templates/admin/index.tpl index 2d548c459c..3fac2b0917 100644 --- a/public/templates/admin/index.tpl +++ b/public/templates/admin/index.tpl @@ -36,4 +36,29 @@ +