From 89e135d3bf0d0e51112cf5646e9488edef871d14 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Tue, 27 Nov 2012 18:14:25 -0500 Subject: [PATCH] Add loading --- js/id/ui/loading.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 js/id/ui/loading.js 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; +};