Use arrow functions when it applies

This commit is contained in:
Daniel García Aubert 2018-01-09 11:20:20 +01:00
parent d908ffdbca
commit 183c8291bc

View File

@ -136,7 +136,7 @@ NamedMapsController.prototype.prepareLayerFilterFromPreviewLayers = function (la
var previewLayers = template.view.preview_layers;
var layerVisibilityFilter = [];
template.layergroup.layers.forEach(function (layer, index) {
template.layergroup.layers.forEach((layer, index) => {
if (previewLayers[''+index] !== false && previewLayers[layer.id] !== false) {
layerVisibilityFilter.push(''+index);
}
@ -372,9 +372,7 @@ function templateZoomCenter(view) {
function templateBounds(view) {
if (view.bounds) {
var hasAllBounds = ['west', 'south', 'east', 'north'].every(function(prop) {
return Number.isFinite(view.bounds[prop]);
});
var hasAllBounds = ['west', 'south', 'east', 'north'].every(prop => Number.isFinite(view.bounds[prop]));
if (hasAllBounds) {
return {