fix comparison in determineMode, fixes problems with restoring the filter mode (assisted or manually) on page refresh

This commit is contained in:
Arthur Schiwon 2014-04-11 13:56:06 +02:00
parent 6f1e9f8920
commit e28227ecdc
1 changed files with 4 additions and 1 deletions

View File

@ -64,13 +64,16 @@ LdapFilter.prototype.determineMode = function() {
LdapWizard.ajax(param,
function(result) {
property = 'ldap' + filter.target + 'FilterMode';
filter.mode = result.changes[property];
filter.mode = parseInt(result.changes[property]);
if(filter.mode === LdapWizard.filterModeRaw
&& $('#raw'+filter.target+'FilterContainer').hasClass('invisible')) {
LdapWizard['toggleRaw'+filter.target+'Filter']();
} else if(filter.mode === LdapWizard.filterModeAssisted
&& !$('#raw'+filter.target+'FilterContainer').hasClass('invisible')) {
LdapWizard['toggleRaw'+filter.target+'Filter']();
} else {
console.log('LDAP Wizard determineMode: returned mode was »' +
filter.mode + '« of type ' + typeof filter.mode);
}
filter.unlock();
},