Loading indicator for notes
This commit is contained in:
parent
7a435df917
commit
4bfbdcc2f1
2 changed files with 16 additions and 1 deletions
|
@ -135,7 +135,9 @@ function initializeBrowse(map) {
|
|||
}
|
||||
|
||||
function setStatus(status) {
|
||||
$('#browse_status').append($('<p></p>').text(status));
|
||||
if($('#browse_status').is(':empty')) {
|
||||
$('#browse_status').append($('<p></p>').text(status));
|
||||
}
|
||||
}
|
||||
|
||||
function clearStatus() {
|
||||
|
|
|
@ -68,13 +68,26 @@ OSM.Note = function(map) {
|
|||
};
|
||||
|
||||
page.load = function() {
|
||||
var loadTimer = setTimeout(setLoading, 250);
|
||||
$('#sidebar_content').load(window.location.pathname + "?xhr=1", function(a, b, xhr) {
|
||||
if (xhr.getResponseHeader('X-Page-Title')) {
|
||||
document.title = xhr.getResponseHeader('X-Page-Title');
|
||||
}
|
||||
bind();
|
||||
clearTimeout(loadTimer);
|
||||
clearLoading();
|
||||
});
|
||||
};
|
||||
|
||||
function setLoading() {
|
||||
if($('#browse_status').is(':empty')) {
|
||||
$('#browse_status').append($('<p></p>').text(I18n.t('browse.start_rjs.loading')));
|
||||
}
|
||||
}
|
||||
|
||||
function clearLoading() {
|
||||
$('#browse_status').empty();
|
||||
}
|
||||
|
||||
return page;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue