From c4c0e8105a8edc35205add749f461ec7be689aef Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sun, 14 Jul 2019 10:52:18 +0100 Subject: [PATCH 1/1] Enforce consistent indentation in javascript code --- app/assets/javascripts/application.js | 4 +- app/assets/javascripts/id.js | 4 +- app/assets/javascripts/index.js | 16 ++-- app/assets/javascripts/index/changeset.js | 4 +- app/assets/javascripts/index/directions.js | 10 +- app/assets/javascripts/index/export.js | 6 +- app/assets/javascripts/index/history.js | 6 +- app/assets/javascripts/index/new_note.js | 10 +- app/assets/javascripts/index/note.js | 10 +- app/assets/javascripts/index/query.js | 46 +++++----- app/assets/javascripts/index/search.js | 2 +- app/assets/javascripts/leaflet.key.js | 6 +- app/assets/javascripts/leaflet.layers.js | 6 +- app/assets/javascripts/leaflet.map.js | 30 +++--- app/assets/javascripts/leaflet.query.js | 2 +- app/assets/javascripts/leaflet.share.js | 26 +++--- app/assets/javascripts/leaflet.sidebar.js | 8 +- app/assets/javascripts/leaflet.zoom.js | 102 ++++++++++----------- app/assets/javascripts/router.js | 8 +- config/eslint.json | 7 ++ 20 files changed, 160 insertions(+), 153 deletions(-) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index b7acc3310..7c2e4665e 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -26,8 +26,8 @@ var qs = require("querystring-component"); window.updateLinks = function (loc, zoom, layers, object) { $(".geolink").each(function (index, link) { var href = link.href.split(/[?#]/)[0], - args = qs.parse(link.search.substring(1)), - editlink = $(link).hasClass("editlink"); + args = qs.parse(link.search.substring(1)), + editlink = $(link).hasClass("editlink"); delete args.node; delete args.way; diff --git a/app/assets/javascripts/id.js b/app/assets/javascripts/id.js index 0aae749f7..ba16d9df2 100644 --- a/app/assets/javascripts/id.js +++ b/app/assets/javascripts/id.js @@ -27,8 +27,8 @@ document.addEventListener("DOMContentLoaded", function () { id.map().on("move.embed", parent.$.throttle(250, function () { if (id.inIntro()) return; var zoom = ~~id.map().zoom(), - center = id.map().center(), - llz = { lon: center[0], lat: center[1], zoom: zoom }; + center = id.map().center(), + llz = { lon: center[0], lat: center[1], zoom: zoom }; parent.updateLinks(llz, zoom); diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index 6228b2376..fd707e566 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -234,7 +234,7 @@ $(document).ready(function () { e.preventDefault(); var data = $(this).data(), - center = L.latLng(data.lat, data.lon); + center = L.latLng(data.lat, data.lon); map.setView(center, data.zoom); L.marker(center, { icon: OSM.getUserIcon() }).addTo(map); @@ -260,13 +260,13 @@ $(document).ready(function () { if (object) query.select = object.type + object.id; var iframe = $("