Update prettier version
This commit is contained in:
parent
c49b821db7
commit
25429b3c24
42 changed files with 2480 additions and 2490 deletions
|
|
@ -1,29 +1,29 @@
|
|||
BR.stravaSegments = function(map, layersControl) {
|
||||
BR.stravaSegments = function (map, layersControl) {
|
||||
var stravaControl = L.control
|
||||
.stravaSegments({
|
||||
runningTitle: i18next.t('map.strava-shortcut', { action: '$t(map.strava-running)', key: 'S' }),
|
||||
bikingTitle: i18next.t('map.strava-shortcut', { action: '$t(map.strava-biking)', key: 'S' }),
|
||||
loadingTitle: i18next.t('map.loading'),
|
||||
stravaToken: BR.keys.strava
|
||||
stravaToken: BR.keys.strava,
|
||||
})
|
||||
.addTo(map);
|
||||
layersControl.addOverlay(stravaControl.stravaLayer, i18next.t('map.layer.strava-segments'));
|
||||
stravaControl.onError = function(err) {
|
||||
stravaControl.onError = function (err) {
|
||||
BR.message.showError(
|
||||
i18next.t('warning.strava-error', {
|
||||
error: err && err.message ? err.message : err
|
||||
error: err && err.message ? err.message : err,
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
L.setOptions(this, {
|
||||
shortcut: {
|
||||
toggleLayer: 83 // char code for 's'
|
||||
}
|
||||
toggleLayer: 83, // char code for 's'
|
||||
},
|
||||
});
|
||||
|
||||
// hide strava buttons when layer is inactive
|
||||
var toggleStravaControl = function() {
|
||||
var toggleStravaControl = function () {
|
||||
var stravaBar = stravaControl.runningButton.button.parentElement;
|
||||
stravaBar.hidden = !stravaBar.hidden;
|
||||
};
|
||||
|
|
@ -33,7 +33,7 @@ BR.stravaSegments = function(map, layersControl) {
|
|||
L.DomEvent.addListener(
|
||||
document,
|
||||
'keydown',
|
||||
function(e) {
|
||||
function (e) {
|
||||
if (BR.Util.keyboardShortcutsAllowed(e) && e.keyCode === this.options.shortcut.toggleLayer) {
|
||||
if (map.hasLayer(stravaControl.stravaLayer)) {
|
||||
map.removeLayer(stravaControl.stravaLayer);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue