Wait globe to load world.jpg before display it
This commit is contained in:
parent
5af32f21fd
commit
a3bba8c14c
2 changed files with 47 additions and 39 deletions
|
@ -351,6 +351,9 @@ class Sidebar extends Class
|
|||
|
||||
|
||||
displayGlobe: =>
|
||||
img = new Image();
|
||||
img.src = "/uimedia/globe/world.jpg";
|
||||
img.onload = =>
|
||||
wrapper.ws.cmd "sidebarGetPeers", [], (globe_data) =>
|
||||
if @globe
|
||||
@globe.scene.remove(@globe.points)
|
||||
|
|
|
@ -601,8 +601,12 @@ window.initScrollable = function () {
|
|||
};
|
||||
|
||||
Sidebar.prototype.displayGlobe = function() {
|
||||
return wrapper.ws.cmd("sidebarGetPeers", [], (function(_this) {
|
||||
return function(globe_data) {
|
||||
var img;
|
||||
img = new Image();
|
||||
img.src = "/uimedia/globe/world.jpg";
|
||||
return img.onload = (function(_this) {
|
||||
return function() {
|
||||
return wrapper.ws.cmd("sidebarGetPeers", [], function(globe_data) {
|
||||
var e;
|
||||
if (_this.globe) {
|
||||
_this.globe.scene.remove(_this.globe.points);
|
||||
|
@ -630,8 +634,9 @@ window.initScrollable = function () {
|
|||
}
|
||||
}
|
||||
return _this.tag.find(".globe").removeClass("loading");
|
||||
});
|
||||
};
|
||||
})(this));
|
||||
})(this);
|
||||
};
|
||||
|
||||
Sidebar.prototype.unloadGlobe = function() {
|
||||
|
|
Loading…
Reference in a new issue