put Add Group elements hiding and showing into its own function

remotes/origin/ldap_group_count
Arthur Schiwon 11 years ago
parent 330dfeb46b
commit 480173569f
  1. 19
      settings/js/users/groups.js

@ -29,6 +29,19 @@
}
},
toggleAddGroup: function(event) {
if($('#newgroup-init').is(":visible")) {
event.stopPropagation();
$('#newgroup-form').show();
$('#newgroup-init').hide();
$('#newgroupname').focus();
} else {
$('#newgroup-form').hide();
$('#newgroup-init').show();
$('#newgroupname').val('');
}
},
finishDelete: function (ready) {
if (!GroupList.deleteCanceled && GroupList.deleteGid) {
$.ajax({
@ -68,10 +81,7 @@ $(document).ready( function () {
// Display or hide of Create Group List Element
$('#newgroup-form').hide();
$('#newgroup-init').on('click', function (e) {
e.stopPropagation();
$('#newgroup-form').show();
$('#newgroup-init').hide();
$('#newgroupname').focus();
GroupList.toggleAddGroup(e);
});
// Responsible for Creating Groups.
@ -98,6 +108,7 @@ $(document).ready( function () {
var addedGroups = result.data.groupname;
UserList.availableGroups = $.unique($.merge(UserList.availableGroups, addedGroups));
}
GroupList.toggleAddGroup();
}
}
)

Loading…
Cancel
Save