From 0b1ef000777445b0eeec0285fe8fc20a04f281ad Mon Sep 17 00:00:00 2001 From: shortcutme Date: Mon, 15 Aug 2016 13:56:43 +0200 Subject: [PATCH] Fix sidebar js errors after close --- plugins/Sidebar/media/Sidebar.coffee | 5 ++--- plugins/Sidebar/media/all.js | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/plugins/Sidebar/media/Sidebar.coffee b/plugins/Sidebar/media/Sidebar.coffee index 0a34419a..69b22570 100644 --- a/plugins/Sidebar/media/Sidebar.coffee +++ b/plugins/Sidebar/media/Sidebar.coffee @@ -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: => diff --git a/plugins/Sidebar/media/all.js b/plugins/Sidebar/media/all.js index 82c5751b..24121661 100644 --- a/plugins/Sidebar/media/all.js +++ b/plugins/Sidebar/media/all.js @@ -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);