don't hide add group when text is entered (except for ESC press)

This commit is contained in:
Arthur Schiwon 2014-02-25 16:11:20 +01:00
parent 853ced644d
commit cfba7e20cf

View file

@ -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