Update prettier version

This commit is contained in:
Gautier P 2020-12-05 11:50:30 +01:00
parent c49b821db7
commit 25429b3c24
42 changed files with 2480 additions and 2490 deletions

View file

@ -5,24 +5,21 @@ BR.Elevation = L.Control.Elevation.extend({
top: 20,
right: 30,
bottom: 30,
left: 60
left: 60,
},
theme: 'steelblue-theme',
shortcut: {
toggle: 69 // char code for 'e'
}
toggle: 69, // char code for 'e'
},
},
onAdd: function(map) {
onAdd: function (map) {
var container = L.Control.Elevation.prototype.onAdd.call(this, map);
// revert registering touch events when touch screen detection is available and negative
// see https://github.com/MrMufflon/Leaflet.Elevation/issues/67
if (L.Browser.touch && BR.Browser.touchScreenDetectable && !BR.Browser.touchScreen) {
this._background
.on('touchmove.drag', null)
.on('touchstart.drag', null)
.on('touchstart.focus', null);
this._background.on('touchmove.drag', null).on('touchstart.drag', null).on('touchstart.focus', null);
L.DomEvent.off(this._container, 'touchend', this._dragEndHandler, this);
this._background
@ -38,7 +35,7 @@ BR.Elevation = L.Control.Elevation.extend({
return container;
},
addBelow: function(map) {
addBelow: function (map) {
// waiting for https://github.com/MrMufflon/Leaflet.Elevation/pull/66
// this.width($('#map').outerWidth());
this.options.width = $('#content').outerWidth();
@ -55,9 +52,9 @@ BR.Elevation = L.Control.Elevation.extend({
setParent(this.getContainer(), document.getElementById('elevation-chart'));
},
initCollapse: function(map) {
initCollapse: function (map) {
var self = this;
var onHide = function() {
var onHide = function () {
$('#elevation-btn').removeClass('active');
// we must fetch tiles that are located behind elevation-chart
map._onResize();
@ -66,7 +63,7 @@ BR.Elevation = L.Control.Elevation.extend({
localStorage.removeItem(this.id);
}
};
var onShow = function() {
var onShow = function () {
$('#elevation-btn').addClass('active');
if (this.id && BR.Util.localStorageAvailable()) {
@ -77,14 +74,14 @@ BR.Elevation = L.Control.Elevation.extend({
$('#elevation-chart')
.on('hidden.bs.collapse', onHide)
.on('shown.bs.collapse', onShow)
.each(function() {
.each(function () {
if (this.id && BR.Util.localStorageAvailable() && localStorage[this.id] === 'true') {
self.shouldRestoreChart = true;
}
});
},
update: function(track, layer) {
update: function (track, layer) {
this.clear();
// bring height indicator to front, because of track casing in BR.Routing
@ -108,9 +105,9 @@ BR.Elevation = L.Control.Elevation.extend({
}
},
_keydownListener: function(e) {
_keydownListener: function (e) {
if (BR.Util.keyboardShortcutsAllowed(e) && e.keyCode === this.options.shortcut.toggle) {
$('#elevation-btn').click();
}
}
},
});