[Pkg-owncloud-commits] [owncloud] 08/34: on xp'ed mode and switching configurations: save raw mode instead of toggling filter mode in tabs since their status is unknown and dealt with by the Wizard. Fixes #11848

David Prévot taffit at moszumanska.debian.org
Fri Nov 7 11:44:10 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit aeb9e172a98eeee26c4e3141b863c5ad44ff13ab
Author: Arthur Schiwon <blizzz at owncloud.com>
Date:   Wed Oct 29 18:52:55 2014 +0100

    on xp'ed mode and switching configurations: save raw mode instead of toggling filter mode in tabs since their status is unknown and dealt with by the Wizard. Fixes #11848
    
    Backport of 8a48b088ed22f23f961da3c0eb9591989f8cc98a from master
---
 apps/user_ldap/js/experiencedAdmin.js | 14 +++-----------
 apps/user_ldap/js/settings.js         | 10 +++++++---
 2 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/apps/user_ldap/js/experiencedAdmin.js b/apps/user_ldap/js/experiencedAdmin.js
index fac8dd6..8d138ee 100644
--- a/apps/user_ldap/js/experiencedAdmin.js
+++ b/apps/user_ldap/js/experiencedAdmin.js
@@ -50,17 +50,9 @@ ExperiencedAdmin.prototype.isExperienced = function() {
  * switches all LDAP filters from Assisted to Raw mode.
  */
 ExperiencedAdmin.prototype.enableRawMode = function() {
-	var containers = {
-		'toggleRawGroupFilter': '#rawGroupFilterContainer',
-		'toggleRawLoginFilter': '#rawLoginFilterContainer',
-		'toggleRawUserFilter' : '#rawUserFilterContainer'
-	};
-
-	for(var method in containers) {
-		if($(containers[method]).hasClass('invisible')) {
-			this.wizard[method]();
-		}
-	}
+	LdapWizard._save({id: 'ldapGroupFilterMode'}, LdapWizard.filterModeRaw);
+	LdapWizard._save({id: 'ldapUserFilterMode' }, LdapWizard.filterModeRaw);
+	LdapWizard._save({id: 'ldapLoginFilterMode'}, LdapWizard.filterModeRaw);
 };
 
 ExperiencedAdmin.prototype.updateUserTab = function(mode) {
diff --git a/apps/user_ldap/js/settings.js b/apps/user_ldap/js/settings.js
index 1627528..fa40aba 100644
--- a/apps/user_ldap/js/settings.js
+++ b/apps/user_ldap/js/settings.js
@@ -838,9 +838,10 @@ var LdapWizard = {
 		}
 	},
 
-	onToggleRawFilterConfirmation: function(currentMode, callback) {
-		if(!LdapWizard.admin.isExperienced()
-			|| currentMode === LdapWizard.filterModeAssisted
+	onToggleRawFilterConfirmation: function(currentMode, isRawVisible, callback) {
+		if(   !LdapWizard.admin.isExperienced()
+		   || currentMode === LdapWizard.filterModeAssisted
+		   || (LdapWizard.admin.isExperienced() && !isRawVisible)
 		) {
 			return callback(true);
 		}
@@ -855,6 +856,7 @@ var LdapWizard = {
 	toggleRawGroupFilter: function() {
 		LdapWizard.onToggleRawFilterConfirmation(
 			LdapWizard.groupFilter.getMode(),
+			!$('#rawGroupFilterContainer').hasClass('invisible'),
 			function(confirmed) {
 				if(confirmed !== true) {
 					return;
@@ -875,6 +877,7 @@ var LdapWizard = {
 	toggleRawLoginFilter: function() {
 		LdapWizard.onToggleRawFilterConfirmation(
 			LdapWizard.loginFilter.getMode(),
+			!$('#rawLoginFilterContainer').hasClass('invisible'),
 			function(confirmed) {
 				if(confirmed !== true) {
 					return;
@@ -909,6 +912,7 @@ var LdapWizard = {
 	toggleRawUserFilter: function() {
 		LdapWizard.onToggleRawFilterConfirmation(
 			LdapWizard.userFilter.getMode(),
+			!$('#rawUserFilterContainer').hasClass('invisible'),
 			function(confirmed) {
 				if(confirmed === true) {
 					LdapWizard.blacklistRemove('ldap_userlist_filter');

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list