summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2013-10-24 18:21:02 +0200
committerArthur Schiwon <blizzz@owncloud.com>2013-10-24 18:21:02 +0200
commit7fa418c81a0d6a159d126099b853d8b083c70ff5 (patch)
tree16b8b2540c939a49df4e5d34f32a8dc03fa09d9d
parent20f46602bdee9cbcb1bd2d4246973c423cc62b64 (diff)
downloadnextcloud-server-7fa418c81a0d6a159d126099b853d8b083c70ff5.tar.gz
nextcloud-server-7fa418c81a0d6a159d126099b853d8b083c70ff5.zip
LDAP Wizard: always show correct Back+Continue Buttons, fixes #5520
-rw-r--r--apps/user_ldap/js/settings.js38
1 files changed, 28 insertions, 10 deletions
diff --git a/apps/user_ldap/js/settings.js b/apps/user_ldap/js/settings.js
index faef477420f..4c2f182dad8 100644
--- a/apps/user_ldap/js/settings.js
+++ b/apps/user_ldap/js/settings.js
@@ -272,13 +272,8 @@ var LdapWizard = {
if(curTabIndex == 0) {
return;
}
- if(curTabIndex == 1) {
- $('.ldap_action_back').addClass('invisible');
- }
$('#ldapSettings').tabs('option', 'active', curTabIndex - 1);
- if(curTabIndex == 3) {
- $('.ldap_action_continue').removeClass('invisible');
- }
+ LdapWizard.controlUpdate(curTabIndex - 1);
},
controlContinue: function() {
@@ -287,12 +282,26 @@ var LdapWizard = {
return;
}
$('#ldapSettings').tabs('option', 'active', 1 + curTabIndex);
- if(curTabIndex == 2) {
+ LdapWizard.controlUpdate(curTabIndex + 1);
+ },
+
+ controlUpdate: function(nextTabIndex) {
+ if(nextTabIndex == 0) {
+ $('.ldap_action_back').addClass('invisible');
+ $('.ldap_action_continue').removeClass('invisible');
+ } else
+ if(nextTabIndex == 1) {
+ $('.ldap_action_back').removeClass('invisible');
+ $('.ldap_action_continue').removeClass('invisible');
+ } else
+ if(nextTabIndex == 2) {
+ $('.ldap_action_continue').removeClass('invisible');
+ $('.ldap_action_back').removeClass('invisible');
+ } else
+ if(nextTabIndex == 3) {
//now last tab
- $('.ldap_action_continue').addClass('invisible');
- }
- if(curTabIndex == 0) {
$('.ldap_action_back').removeClass('invisible');
+ $('.ldap_action_continue').addClass('invisible');
}
},
@@ -493,12 +502,21 @@ var LdapWizard = {
},
onTabChange: function(event, ui) {
+ newTabIndex = 0;
if(ui.newTab[0].id === '#ldapWizard2') {
LdapWizard.initUserFilter();
+ newTabIndex = 1;
} else if(ui.newTab[0].id === '#ldapWizard3') {
LdapWizard.initLoginFilter();
+ newTabIndex = 2;
} else if(ui.newTab[0].id === '#ldapWizard4') {
LdapWizard.initGroupFilter();
+ newTabIndex = 3;
+ }
+
+ curTabIndex = $('#ldapSettings').tabs('option', 'active');
+ if(curTabIndex >= 0 && curTabIndex <= 3) {
+ LdapWizard.controlUpdate(newTabIndex);
}
},