diff --git a/public/src/admin/manage/users.js b/public/src/admin/manage/users.js index dfda934106..d570941940 100644 --- a/public/src/admin/manage/users.js +++ b/public/src/admin/manage/users.js @@ -1,13 +1,20 @@ "use strict"; -/* global socket, define, templates, bootbox, app, ajaxify */ +/* global config, socket, define, templates, bootbox, app, ajaxify */ -define('admin/manage/users', ['admin/modules/selectable'], function(selectable) { +define('admin/manage/users', ['admin/modules/selectable', 'translator'], function(selectable, translator) { var Users = {}; Users.init = function() { selectable.enable('#users-container', '.users-box'); + var navPills = $('.nav-pills li'); + var pathname = window.location.pathname; + if (!navPills.find('a[href="' + pathname + '"]').length) { + pathname = config.relative_path + '/admin/manage/users/latest'; + } + navPills.removeClass('active').find('a[href="' + pathname + '"]').parent().addClass('active'); + function getSelectedUids() { var uids = []; $('#users-container .users-box.ui-selected').each(function() { @@ -246,7 +253,7 @@ define('admin/manage/users', ['admin/modules/selectable'], function(selectable) create: { label: 'Create', className: 'btn-primary', - callback: function(e) { + callback: function() { createUser.call(this); return false; } @@ -292,7 +299,7 @@ define('admin/manage/users', ['admin/modules/selectable'], function(selectable) var timeoutId = 0; - $('.nav-pills li').removeClass('active').find('a[href="' + window.location.pathname + '"]').parent().addClass('active'); + $('#search-user-name, #search-user-email, #search-user-ip').on('keyup', function() { if (timeoutId !== 0) { diff --git a/src/views/admin/partials/menu.tpl b/src/views/admin/partials/menu.tpl index 34ddbf9acd..b971348439 100644 --- a/src/views/admin/partials/menu.tpl +++ b/src/views/admin/partials/menu.tpl @@ -16,7 +16,7 @@