diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2015-09-24 14:33:37 +0300 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2015-09-24 14:33:37 +0300 |
commit | 8e57757045577abe84b9497179c97023d3ecd3c2 (patch) | |
tree | 3588e4193e6aa37a818690d47e582ca8c7dc964e /apps/user_ldap/js | |
parent | 8d6ec660a277cd0ced350ed706811b65e913ec9b (diff) |
LDAP Wizard: enable/disable test login name button depending on whether a login name is provided or not
Diffstat (limited to 'apps/user_ldap/js')
-rw-r--r-- | apps/user_ldap/js/wizard/wizardTabLoginFilter.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/apps/user_ldap/js/wizard/wizardTabLoginFilter.js b/apps/user_ldap/js/wizard/wizardTabLoginFilter.js index b73d267d168..0316db5b61c 100644 --- a/apps/user_ldap/js/wizard/wizardTabLoginFilter.js +++ b/apps/user_ldap/js/wizard/wizardTabLoginFilter.js @@ -71,7 +71,8 @@ OCA = OCA || {}; ], 'ldap_login_filter_mode' ); - _.bindAll(this, 'onVerifyClick'); + _.bindAll(this, 'onVerifyClick', 'onTestLoginnameChange'); + this.managedItems.ldap_test_loginname.$element.keyup(this.onTestLoginnameChange); this.managedItems.ldap_test_loginname.$relatedElements.click(this.onVerifyClick); }, @@ -231,6 +232,16 @@ OCA = OCA || {}; } else { this.configModel.requestWizard('ldap_test_loginname', {ldap_test_loginname: testLogin}); } + }, + + /** + * enables/disables the "Verify Settings" button, depending whether + * the corresponding text input has a value or not + */ + onTestLoginnameChange: function() { + var loginName = this.managedItems.ldap_test_loginname.$element.val(); + var beDisabled = !_.isString(loginName) || !loginName.trim(); + this.managedItems.ldap_test_loginname.$relatedElements.prop('disabled', beDisabled); } }); |