diff --git a/js/id/ui/loading.js b/js/id/ui/loading.js new file mode 100644 index 000000000..b858e80b6 --- /dev/null +++ b/js/id/ui/loading.js @@ -0,0 +1,16 @@ +iD.loading = function(message) { + var loading = d3.select('div.loading'); + if (loading.empty()) loading = d3.select(document.body) + .append('div').attr('class', 'loading shaded'); + var modal = loading.append('div') + .attr('class', 'modal loading-pane') + .text(message || ''); + + var l = {}; + + l.remove = function() { + d3.select('div.loading').remove(); + }; + + return l; +};