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() @globe.animate()
catch e catch e
console.log "WebGL error", 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: => unloadGlobe: =>

View file

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