diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-03-18 16:29:13 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-03-18 16:29:13 +0100 |
commit | bf6a7080e5145a1f09b660a3064aff03317c4b91 (patch) | |
tree | 33790df6f24e045d2e9aee9f27bfc7fb742da033 | |
parent | e2e16249a1e7b4b3cc35ae4cf74bb4e4f4818e96 (diff) | |
parent | cb4367b6d5af62c8b2c8c384396b3dc29bff2eab (diff) | |
download | nextcloud-server-bf6a7080e5145a1f09b660a3064aff03317c4b91.tar.gz nextcloud-server-bf6a7080e5145a1f09b660a3064aff03317c4b91.zip |
Merge pull request #14997 from owncloud/newgroup-empty-disable
disable submit button while groupname is empty
-rw-r--r-- | settings/js/users/groups.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/settings/js/users/groups.js b/settings/js/users/groups.js index c06bc5ff14b..32ddbf3ba01 100644 --- a/settings/js/users/groups.js +++ b/settings/js/users/groups.js @@ -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); + }); }); |