mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 01:02:58 +00:00
1. All services are disabled in testing now to prevent network accesses 2. Only services are enabled when needed to test something 3. Many changes throughout code to allow iD to run with services disabled (e.g. check for osm service instead of assuming context.connection() will work) 4. Actually export the services so we can disable and enable them
24 lines
624 B
JavaScript
24 lines
624 B
JavaScript
export function uiSpinner(context) {
|
|
var osm = context.connection();
|
|
|
|
|
|
return function(selection) {
|
|
var img = selection
|
|
.append('img')
|
|
.attr('src', context.imagePath('loader-black.gif'))
|
|
.style('opacity', 0);
|
|
|
|
if (osm) {
|
|
osm
|
|
.on('loading.spinner', function() {
|
|
img.transition()
|
|
.style('opacity', 1);
|
|
})
|
|
.on('loaded.spinner', function() {
|
|
img.transition()
|
|
.style('opacity', 0);
|
|
});
|
|
}
|
|
};
|
|
}
|