From 304d01f69db39557b65745366c0967da34ccdaa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sun, 30 Dec 2018 21:46:07 +0100 Subject: [PATCH] (lint) mainRepo: always use global. --- src/index.js | 8 ++++---- src/state.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/index.js b/src/index.js index f6e7dd1b..65350567 100644 --- a/src/index.js +++ b/src/index.js @@ -112,7 +112,7 @@ function onload2 (initState) { state.apply(newState) if ('repo' in newState) { - mainRepo = newState.repo + global.mainRepo = newState.repo } loadBaseCategory() @@ -166,7 +166,7 @@ function onload2 (initState) { } function loadBaseCategory () { - let repo = mainRepo + (mainRepo === '' ? '' : '/') + let repo = global.mainRepo + (global.mainRepo === '' ? '' : '/') OpenStreetBrowserLoader.getCategory(repo + 'index', function (err, category) { if (err) { alert(err) @@ -188,9 +188,9 @@ global.allMapFeatures = function (callback) { window.setPath = function (path, state) { currentPath = path - if ('repo' in state && state.repo !== mainRepo && baseCategory) { + if ('repo' in state && state.repo !== global.mainRepo && baseCategory) { baseCategory.remove() - mainRepo = state.repo + global.mainRepo = state.repo loadBaseCategory() } diff --git a/src/state.js b/src/state.js index d5a906b6..2de3c159 100644 --- a/src/state.js +++ b/src/state.js @@ -6,8 +6,8 @@ function get () { var state = {} // repo - if (mainRepo !== '') { - state.repo = mainRepo + if (global.mainRepo !== '') { + state.repo = global.mainRepo } // path