Fix sidebar js errors after close

This commit is contained in:
shortcutme 2016-08-15 13:56:43 +02:00
parent 92e4dd64d1
commit 0b1ef00077
2 changed files with 6 additions and 7 deletions

View file

@ -388,10 +388,9 @@ class Sidebar extends Class
@globe.animate()
catch e
console.log "WebGL error", e
if @tag
@tag.find(".globe").addClass("error").text("WebGL not supported")
@tag?.find(".globe").addClass("error").text("WebGL not supported")
@tag.find(".globe").removeClass("loading")
@tag?.find(".globe").removeClass("loading")
unloadGlobe: =>

View file

@ -642,7 +642,7 @@ window.initScrollable = function () {
return img.onload = (function(_this) {
return function() {
return wrapper.ws.cmd("sidebarGetPeers", [], function(globe_data) {
var e;
var e, _ref, _ref1;
if (_this.globe) {
_this.globe.scene.remove(_this.globe.points);
_this.globe.addData(globe_data, {
@ -665,12 +665,12 @@ window.initScrollable = function () {
} catch (_error) {
e = _error;
console.log("WebGL error", e);
if (_this.tag) {
_this.tag.find(".globe").addClass("error").text("WebGL not supported");
if ((_ref = _this.tag) != null) {
_ref.find(".globe").addClass("error").text("WebGL not supported");
}
}
}
return _this.tag.find(".globe").removeClass("loading");
return (_ref1 = _this.tag) != null ? _ref1.find(".globe").removeClass("loading") : void 0;
});
};
})(this);