Merge pull request #14997 from owncloud/newgroup-empty-disable

disable submit button while groupname is empty
This commit is contained in:
Morris Jobke 2015-03-18 16:29:13 +01:00
commit bf6a7080e5
1 changed files with 13 additions and 0 deletions

View File

@ -182,6 +182,7 @@ GroupList = {
$('#newgroup-form').show();
$('#newgroup-init').hide();
$('#newgroupname').focus();
GroupList.handleAddGroupInput('');
}
else {
$('#newgroup-form').hide();
@ -190,6 +191,14 @@ GroupList = {
}
},
handleAddGroupInput: function (input) {
if(input.length) {
$('#newgroup-form input[type="submit"]').attr('disabled', null);
} else {
$('#newgroup-form input[type="submit"]').attr('disabled', 'disabled');
}
},
isGroupNameValid: function (groupname) {
if ($.trim(groupname) === '') {
OC.dialogs.alert(
@ -295,4 +304,8 @@ $(document).ready( function () {
$userGroupList.on('click', '.isgroup', function () {
GroupList.showGroup(GroupList.getElementGID(this));
});
$('#newgroupname').on('input', function(){
GroupList.handleAddGroupInput(this.value);
});
});