Loding indicator for tag reference (#1161)

This commit is contained in:
John Firebaugh
2013-03-27 10:30:48 -07:00
parent cffba63891
commit f4c03316d2
4 changed files with 34 additions and 8 deletions

View File

@@ -1288,6 +1288,11 @@ img.wiki-image {
border-radius: 4px;
}
.tag-reference-spinner {
display: block;
margin: auto;
}
/* Map Controls */
.map-control {

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -3,12 +3,18 @@ iD.ui.loading = function(selection, message, blocking) {
var loadertext = modal.select('.content')
.classed('loading-modal', true)
.append('div').attr('class','modal-section fillL');
.append('div')
.attr('class', 'modal-section fillL');
loadertext.append('img').attr('class','loader').attr('src', 'img/loader.gif');
loadertext.append('h3').text(message || '');
loadertext.append('img')
.attr('class', 'loader')
.attr('src', 'img/loader-white.gif');
modal.select('button.close').attr('class','hide');
loadertext.append('h3')
.text(message || '');
modal.select('button.close')
.attr('class', 'hide');
return modal;
};

View File

@@ -31,18 +31,33 @@ iD.ui.TagReference = function(entity, tag) {
selection.classed('cf', true);
var spinner = selection.append('img')
.attr('class', 'tag-reference-spinner')
.attr('src', 'img/loader-white.gif');
taginfo.docs(tag, function(err, docs) {
spinner
.style('position', 'absolute')
.transition()
.style('opacity', 0)
.remove();
var referenceBody = selection.append('div')
.attr('class', 'tag-reference-wrap')
.style('opacity', 0);
referenceBody
.transition()
.style('opacity', 1);
if (!err && docs) {
docs = findLocal(docs);
}
if (!docs || !docs.description) {
return selection.text(t('inspector.no_documentation_key'));
return referenceBody.text(t('inspector.no_documentation_key'));
}
var referenceBody = selection.append('div')
.attr('class','tag-reference-wrap');
if (docs.image && docs.image.thumb_url_prefix) {
referenceBody
.append('img')