diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-02-15 12:02:35 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-02-15 12:02:35 +0100 |
commit | fd21bfd9e894d81b67f375051d21dcdb2074c554 (patch) | |
tree | 20a045fb58a2c8fad71c172a50f9aa46ecafe81d | |
parent | 40188c87a189a45a50e1d96acb222be0a67ab853 (diff) | |
parent | 62aac81c4558f490257088288d37a9dd7596e7b5 (diff) | |
download | nextcloud-server-fd21bfd9e894d81b67f375051d21dcdb2074c554.tar.gz nextcloud-server-fd21bfd9e894d81b67f375051d21dcdb2074c554.zip |
Merge pull request #22358 from owncloud/fix-22278
Fix race condition when switching filter mode. Fixes #22278
-rw-r--r-- | apps/user_ldap/js/wizard/wizardTabGeneric.js | 31 | ||||
-rw-r--r-- | apps/user_ldap/js/wizard/wizardTabGroupFilter.js | 2 | ||||
-rw-r--r-- | apps/user_ldap/js/wizard/wizardTabLoginFilter.js | 2 | ||||
-rw-r--r-- | apps/user_ldap/js/wizard/wizardTabUserFilter.js | 2 |
4 files changed, 32 insertions, 5 deletions
diff --git a/apps/user_ldap/js/wizard/wizardTabGeneric.js b/apps/user_ldap/js/wizard/wizardTabGeneric.js index 8940a8468a0..21085e3a584 100644 --- a/apps/user_ldap/js/wizard/wizardTabGeneric.js +++ b/apps/user_ldap/js/wizard/wizardTabGeneric.js @@ -28,6 +28,12 @@ OCA = OCA || {}; */ bjQuiButtonClass: 'ui-button', + /** + * @property {bool} - indicates whether a filter mode toggle operation + * is still in progress + */ + isToggling: false, + /** @inheritdoc */ init: function(tabIndex, tabID) { this.tabIndex = tabIndex; @@ -408,6 +414,20 @@ OCA = OCA || {}; }, /** + * sets the filter mode initially and resets the "isToggling" marker. + * This method is called after a save operation against the mode key. + * + * @param mode + */ + setFilterModeOnce: function(mode) { + this.isToggling = false; + if(!this.filterModeInitialized) { + this.filterModeInitialized = true; + this.setFilterMode(mode); + } + }, + + /** * sets the filter mode according to the provided configuration value * * @param {string} mode @@ -568,8 +588,15 @@ OCA = OCA || {}; this.filterModeDisableableElements = filterModeDisableableElements; this.filterModeStateElement = filterModeStateElement; this.filterModeKey = filterModeKey; - $switcher.click(this._toggleRawFilterMode); - } + var view = this; + $switcher.click(function() { + if(view.isToggling) { + return; + } + view.isToggling = true; + view._toggleRawFilterMode(); + }); + }, }); diff --git a/apps/user_ldap/js/wizard/wizardTabGroupFilter.js b/apps/user_ldap/js/wizard/wizardTabGroupFilter.js index 528b5d83670..3fbff9de9a0 100644 --- a/apps/user_ldap/js/wizard/wizardTabGroupFilter.js +++ b/apps/user_ldap/js/wizard/wizardTabGroupFilter.js @@ -26,7 +26,7 @@ OCA = OCA || {}; featureName: 'GroupObjectClasses' }, ldap_group_filter_mode: { - setMethod: 'setFilterMode' + setMethod: 'setFilterModeOnce' }, ldap_groupfilter_groups: { $element: $('#ldap_groupfilter_groups'), diff --git a/apps/user_ldap/js/wizard/wizardTabLoginFilter.js b/apps/user_ldap/js/wizard/wizardTabLoginFilter.js index 691ddb5ac9a..7b9a408784a 100644 --- a/apps/user_ldap/js/wizard/wizardTabLoginFilter.js +++ b/apps/user_ldap/js/wizard/wizardTabLoginFilter.js @@ -32,7 +32,7 @@ OCA = OCA || {}; setMethod: 'setLoginAttributeEmail' }, ldap_login_filter_mode: { - setMethod: 'setFilterMode' + setMethod: 'setFilterModeOnce' }, ldap_loginfilter_attributes: { $element: $('#ldap_loginfilter_attributes'), diff --git a/apps/user_ldap/js/wizard/wizardTabUserFilter.js b/apps/user_ldap/js/wizard/wizardTabUserFilter.js index 4fe223ee075..da7cb77568e 100644 --- a/apps/user_ldap/js/wizard/wizardTabUserFilter.js +++ b/apps/user_ldap/js/wizard/wizardTabUserFilter.js @@ -26,7 +26,7 @@ OCA = OCA || {}; featureName: 'UserObjectClasses' }, ldap_user_filter_mode: { - setMethod: 'setFilterMode' + setMethod: 'setFilterModeOnce' }, ldap_userfilter_groups: { $element: $('#ldap_userfilter_groups'), |