summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/js/wizard/wizardTabGeneric.js
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@owncloud.com>2016-02-12 21:51:06 +0100
committerArthur Schiwon <blizzz@owncloud.com>2016-02-12 21:51:06 +0100
commit62aac81c4558f490257088288d37a9dd7596e7b5 (patch)
treedec9b496e7890494d92a2c1aaa3f9af1fc3793b7 /apps/user_ldap/js/wizard/wizardTabGeneric.js
parentb5bf32bc34a410d1f0756ffcda5eb7dfeca67134 (diff)
downloadnextcloud-server-62aac81c4558f490257088288d37a9dd7596e7b5.tar.gz
nextcloud-server-62aac81c4558f490257088288d37a9dd7596e7b5.zip
Fix race condition when switching filter mode. Fixes #22278
Diffstat (limited to 'apps/user_ldap/js/wizard/wizardTabGeneric.js')
-rw-r--r--apps/user_ldap/js/wizard/wizardTabGeneric.js31
1 files changed, 29 insertions, 2 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();
+ });
+ },
});