diff --git a/umap/static/umap/js/modules/global.js b/umap/static/umap/js/modules/global.js index a9485375..51ba37d0 100644 --- a/umap/static/umap/js/modules/global.js +++ b/umap/static/umap/js/modules/global.js @@ -1,5 +1,8 @@ import * as L from '../../vendors/leaflet/leaflet-src.esm.js' +import URLs from './urls.js' +// Import modules and export them to the global scope. +// For the not yet module-compatible JS out there. -// Exposes the modules to the window global scope, it's expected by leaflet plugins -// in a writeable form. +// Copy the leaflet module, it's expected by leaflet plugins to be writeable. window.L = { ...L } +window.umap = { URLs } diff --git a/umap/static/umap/js/modules/index.js b/umap/static/umap/js/modules/index.js deleted file mode 100644 index c9f37269..00000000 --- a/umap/static/umap/js/modules/index.js +++ /dev/null @@ -1,6 +0,0 @@ -import URLs from './urls.js' - -// expose the modules to the window.umap global scope -window.umap = { URLs } - -export { URLs } diff --git a/umap/static/umap/test/index.html b/umap/static/umap/test/index.html index 0d643766..d809370f 100644 --- a/umap/static/umap/test/index.html +++ b/umap/static/umap/test/index.html @@ -29,7 +29,6 @@ - diff --git a/umap/templates/umap/content.html b/umap/templates/umap/content.html index 2dd3d64a..29cc8329 100644 --- a/umap/templates/umap/content.html +++ b/umap/templates/umap/content.html @@ -38,7 +38,7 @@ {% block bottom_js %} {{ block.super }} - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + {% endcompress %} {% if locale %}{% endif %} {% compress js %} - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + {% endcompress %} diff --git a/umap/templates/umap/map_fragment.html b/umap/templates/umap/map_fragment.html index 5ff40350..9aef37c9 100644 --- a/umap/templates/umap/map_fragment.html +++ b/umap/templates/umap/map_fragment.html @@ -3,7 +3,7 @@ diff --git a/umap/templates/umap/map_init.html b/umap/templates/umap/map_init.html index c7e36560..61b8a6bc 100644 --- a/umap/templates/umap/map_init.html +++ b/umap/templates/umap/map_init.html @@ -2,7 +2,7 @@