Fix race condition when switching filter mode. Fixes #22278

remotes/origin/users-ajaxloadgroups
Arthur Schiwon 9 years ago
parent b5bf32bc34
commit 62aac81c45
  1. 29
      apps/user_ldap/js/wizard/wizardTabGeneric.js
  2. 2
      apps/user_ldap/js/wizard/wizardTabGroupFilter.js
  3. 2
      apps/user_ldap/js/wizard/wizardTabLoginFilter.js
  4. 2
      apps/user_ldap/js/wizard/wizardTabUserFilter.js

@ -28,6 +28,12 @@ OCA = OCA || {};
*/ */
bjQuiButtonClass: 'ui-button', bjQuiButtonClass: 'ui-button',
/**
* @property {bool} - indicates whether a filter mode toggle operation
* is still in progress
*/
isToggling: false,
/** @inheritdoc */ /** @inheritdoc */
init: function(tabIndex, tabID) { init: function(tabIndex, tabID) {
this.tabIndex = tabIndex; this.tabIndex = tabIndex;
@ -407,6 +413,20 @@ OCA = OCA || {};
this.configModel.requestWizard(this.filterName); this.configModel.requestWizard(this.filterName);
}, },
/**
* 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 * sets the filter mode according to the provided configuration value
* *
@ -568,8 +588,15 @@ OCA = OCA || {};
this.filterModeDisableableElements = filterModeDisableableElements; this.filterModeDisableableElements = filterModeDisableableElements;
this.filterModeStateElement = filterModeStateElement; this.filterModeStateElement = filterModeStateElement;
this.filterModeKey = filterModeKey; this.filterModeKey = filterModeKey;
$switcher.click(this._toggleRawFilterMode); var view = this;
$switcher.click(function() {
if(view.isToggling) {
return;
} }
view.isToggling = true;
view._toggleRawFilterMode();
});
},
}); });

@ -26,7 +26,7 @@ OCA = OCA || {};
featureName: 'GroupObjectClasses' featureName: 'GroupObjectClasses'
}, },
ldap_group_filter_mode: { ldap_group_filter_mode: {
setMethod: 'setFilterMode' setMethod: 'setFilterModeOnce'
}, },
ldap_groupfilter_groups: { ldap_groupfilter_groups: {
$element: $('#ldap_groupfilter_groups'), $element: $('#ldap_groupfilter_groups'),

@ -32,7 +32,7 @@ OCA = OCA || {};
setMethod: 'setLoginAttributeEmail' setMethod: 'setLoginAttributeEmail'
}, },
ldap_login_filter_mode: { ldap_login_filter_mode: {
setMethod: 'setFilterMode' setMethod: 'setFilterModeOnce'
}, },
ldap_loginfilter_attributes: { ldap_loginfilter_attributes: {
$element: $('#ldap_loginfilter_attributes'), $element: $('#ldap_loginfilter_attributes'),

@ -26,7 +26,7 @@ OCA = OCA || {};
featureName: 'UserObjectClasses' featureName: 'UserObjectClasses'
}, },
ldap_user_filter_mode: { ldap_user_filter_mode: {
setMethod: 'setFilterMode' setMethod: 'setFilterModeOnce'
}, },
ldap_userfilter_groups: { ldap_userfilter_groups: {
$element: $('#ldap_userfilter_groups'), $element: $('#ldap_userfilter_groups'),

Loading…
Cancel
Save