Merge pull request #14997 from owncloud/newgroup-empty-disable
disable submit button while groupname is empty
This commit is contained in:
commit
bf6a7080e5
|
@ -182,6 +182,7 @@ GroupList = {
|
||||||
$('#newgroup-form').show();
|
$('#newgroup-form').show();
|
||||||
$('#newgroup-init').hide();
|
$('#newgroup-init').hide();
|
||||||
$('#newgroupname').focus();
|
$('#newgroupname').focus();
|
||||||
|
GroupList.handleAddGroupInput('');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$('#newgroup-form').hide();
|
$('#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) {
|
isGroupNameValid: function (groupname) {
|
||||||
if ($.trim(groupname) === '') {
|
if ($.trim(groupname) === '') {
|
||||||
OC.dialogs.alert(
|
OC.dialogs.alert(
|
||||||
|
@ -295,4 +304,8 @@ $(document).ready( function () {
|
||||||
$userGroupList.on('click', '.isgroup', function () {
|
$userGroupList.on('click', '.isgroup', function () {
|
||||||
GroupList.showGroup(GroupList.getElementGID(this));
|
GroupList.showGroup(GroupList.getElementGID(this));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#newgroupname').on('input', function(){
|
||||||
|
GroupList.handleAddGroupInput(this.value);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue