]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/id.js
Merge branch 'wheres_this' of https://github.com/pnorman/openstreetmap-website into...
[rails.git] / app / assets / javascripts / id.js
index e1fea17684c005a37966e0625cc81f97eb1de40d..dd7cd3325f10f293311e79435cec6633a3d1f8ac 100644 (file)
@@ -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,