aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-03-18 16:29:13 +0100
committerMorris Jobke <hey@morrisjobke.de>2015-03-18 16:29:13 +0100
commitbf6a7080e5145a1f09b660a3064aff03317c4b91 (patch)
tree33790df6f24e045d2e9aee9f27bfc7fb742da033
parente2e16249a1e7b4b3cc35ae4cf74bb4e4f4818e96 (diff)
parentcb4367b6d5af62c8b2c8c384396b3dc29bff2eab (diff)
downloadnextcloud-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.js13
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);
+ });
});