mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-01 07:57:59 +02:00
b5c95af3b7
(closes #3497)
24 lines
606 B
JavaScript
24 lines
606 B
JavaScript
export function uiSpinner(context) {
|
|
var connection = context.connection();
|
|
|
|
|
|
return function(selection) {
|
|
var img = selection
|
|
.append('img')
|
|
.attr('src', context.imagePath('loader-black.gif'))
|
|
.style('opacity', 0);
|
|
|
|
connection.event
|
|
.on('loading.spinner', function() {
|
|
img.transition()
|
|
.style('opacity', 1);
|
|
});
|
|
|
|
connection.event
|
|
.on('loaded.spinner', function() {
|
|
img.transition()
|
|
.style('opacity', 0);
|
|
});
|
|
};
|
|
}
|