X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/293fb9946705417b1d313feb8c65beadaf92a5d3..1a66467ef610901163e3dd15167a66df7af1b4d2:/app/assets/javascripts/id.js diff --git a/app/assets/javascripts/id.js b/app/assets/javascripts/id.js index e1fea1768..dd7cd3325 100644 --- a/app/assets/javascripts/id.js +++ b/app/assets/javascripts/id.js @@ -1,9 +1,11 @@ //= require iD -document.addEventListener("DOMContentLoaded", function(e) { +/* globals iD */ + +document.addEventListener("DOMContentLoaded", function() { var container = document.getElementById("id-container"); - if (typeof iD == 'undefined' || !iD.Detect().support) { + if (typeof iD === 'undefined' || !iD.Detect().support) { container.innerHTML = 'This editor is supported ' + 'in Firefox, Chrome, Safari, Opera, Edge, and Internet Explorer 11. ' + 'Please upgrade your browser or use Potlatch 2 to edit the map.'; @@ -12,7 +14,7 @@ document.addEventListener("DOMContentLoaded", function(e) { var id = iD.Context() .embed(true) .assetPath("iD/") - .assetMap(container.dataset.assetMap) + .assetMap(JSON.parse(container.dataset.assetMap)) .locale(container.dataset.locale, container.dataset.localePath) .preauth({ urlroot: location.protocol + "//" + location.host,