aboutsummaryrefslogtreecommitdiffstats
path: root/public/js
diff options
context:
space:
mode:
authorShyim <shyim@users.noreply.github.com>2017-01-14 14:07:43 +0100
committerLunny Xiao <xiaolunwen@gmail.com>2017-01-14 21:07:43 +0800
commit88f45ce38ccc93dccb5bbffea9ff6328d7612275 (patch)
treec4f0ffa2e7961f1f4909a89b9ccbe77130f6084e /public/js
parent769f77900a5fb05989e96e536d6885423a4cc352 (diff)
downloadgitea-88f45ce38ccc93dccb5bbffea9ff6328d7612275.tar.gz
gitea-88f45ce38ccc93dccb5bbffea9ff6328d7612275.zip
Fix #646 (#669)
Diffstat (limited to 'public/js')
-rw-r--r--public/js/index.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/public/js/index.js b/public/js/index.js
index a3ff42705a..bd22442e5f 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -969,26 +969,28 @@ function initAdmin() {
// New authentication
if ($('.admin.new.authentication').length > 0) {
$('#auth_type').change(function () {
- $('.ldap').hide();
- $('.dldap').hide();
- $('.smtp').hide();
- $('.pam').hide();
- $('.has-tls').hide();
+ $('.ldap, .dldap, .smtp, .pam, .has-tls').hide();
+
+ $('.ldap input[required], .dldap input[required], .smtp input[required], .pam input[required], .has-tls input[required]').removeAttr('required');
var authType = $(this).val();
switch (authType) {
case '2': // LDAP
$('.ldap').show();
+ $('.ldap div.required input').attr('required', 'required');
break;
case '3': // SMTP
$('.smtp').show();
$('.has-tls').show();
+ $('.smtp div.required input, .has-tls').attr('required', 'required');
break;
case '4': // PAM
$('.pam').show();
+ $('.pam input').attr('required', 'required');
break;
case '5': // LDAP
$('.dldap').show();
+ $('.dldap div.required input').attr('required', 'required');
break;
}
@@ -996,6 +998,7 @@ function initAdmin() {
onSecurityProtocolChange()
}
});
+ $('#auth_type').change();
$('#security_protocol').change(onSecurityProtocolChange)
}
// Edit authentication