diff --git a/settings/js/users/groups.js b/settings/js/users/groups.js index 9f8225294b..e5d83b0377 100644 --- a/settings/js/users/groups.js +++ b/settings/js/users/groups.js @@ -79,6 +79,14 @@ && $('#newgroup-form').find($(el)).length === 0); }, + hasAddGroupNameText: function() { + name = $('#newgroupname').val(); + if($.trim(name) === '') { + return false; + } + return true; + }, + showGroup: function (gid) { UserList.empty(); UserList.update(gid); @@ -160,7 +168,8 @@ $(document).ready( function () { $(document).on('click keydown keyup', function(event) { if(!GroupList.isAddGroupButtonVisible() - && !GroupList.elementBelongsToAddGroup(event.target)) { + && !GroupList.elementBelongsToAddGroup(event.target) + && !GroupList.hasAddGroupNameText()) { GroupList.toggleAddGroup(); } // Escape