Fix Custom option not disabled when URL with profile
Getting value of 'profile' ele no longer works (?), replace with proper check if profile name is custom.
This commit is contained in:
parent
09a185c859
commit
a70cf43838
2 changed files with 9 additions and 7 deletions
|
|
@ -58,11 +58,9 @@ BR.RoutingOptions = L.Evented.extend({
|
|||
$('.selectpicker').selectpicker('val', values);
|
||||
this.refreshUI();
|
||||
|
||||
if (options.profile) {
|
||||
// profile got not selected = not in option values -> custom profile passed with permalink
|
||||
if (L.DomUtil.get('profile').value != options.profile) {
|
||||
this.setCustomProfile(options.profile, true);
|
||||
}
|
||||
if (options.profile && L.BRouter.isCustomProfile(options.profile)) {
|
||||
// custom profile passed with permalink
|
||||
this.setCustomProfile(options.profile, true);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,11 @@ L.BRouter = L.Class.extend({
|
|||
PRECISION: 6,
|
||||
NUMBER_SEPARATOR: ',',
|
||||
GROUP_SEPARATOR: '|',
|
||||
ABORTED_ERROR: 'aborted'
|
||||
ABORTED_ERROR: 'aborted',
|
||||
CUSTOM_PREFIX: 'custom_',
|
||||
isCustomProfile: function(profileName) {
|
||||
return profileName && profileName.substring(0, 7) === L.BRouter.CUSTOM_PREFIX;
|
||||
}
|
||||
},
|
||||
|
||||
options: {},
|
||||
|
|
@ -65,7 +69,7 @@ L.BRouter = L.Class.extend({
|
|||
if (params.alternativeidx == 0) delete params.alternativeidx;
|
||||
|
||||
// don't add custom profile, as these are only stored temporarily
|
||||
if (params.profile && params.profile.substring(0, 7) === 'custom_') {
|
||||
if (params.profile && L.BRouter.isCustomProfile(params.profile)) {
|
||||
delete params.profile;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue