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:
Norbert Renner 2019-11-29 12:15:23 +01:00
parent 09a185c859
commit a70cf43838
2 changed files with 9 additions and 7 deletions

View file

@ -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;
}
}