Update JSObserver (reliability, features, config)
* Should now hide/show the div reliably * Message can now be customised by supplying a dict in the config file
This commit is contained in:
@@ -142,17 +142,25 @@ overviewer.views.ProgressView = Backbone.View.extend({
|
||||
this.el.id = 'progressDiv';
|
||||
this.el.innerHTML = 'Current Render Progress';
|
||||
overviewer.map.controls[google.maps.ControlPosition.BOTTOM_RIGHT].push(this.el);
|
||||
this.hidden = true;
|
||||
this.el.hidden = true;
|
||||
$.ajaxSetup({cache: false});
|
||||
},
|
||||
updateProgress: function() {
|
||||
e = this;
|
||||
$.getJSON('progress.js', null, function(d){
|
||||
e.el.hidden = false;
|
||||
e.el.innerHTML = d['message'];
|
||||
if (d.update > 0) {
|
||||
setTimeout("e.updateProgress()", d.update);
|
||||
$.getJSON('progress.json', null, function(d){
|
||||
console.log(d);
|
||||
if (!(d == null||d=='')) {
|
||||
e.el.hidden = false;
|
||||
e.el.innerHTML = d['message'];
|
||||
if (d.update > 0) {
|
||||
setTimeout("e.updateProgress()", d.update);
|
||||
} else {
|
||||
setTimeout("e.updateProgress()", 60000);
|
||||
e.el.innerHTML="Hidden - d.update < 0";
|
||||
e.el.hidden = true;
|
||||
}
|
||||
} else {
|
||||
e.el.innerHTML="Hidden - !!d==false";
|
||||
e.el.hidden = true;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user