From 4707adb2f646fad96a05afa0958d739c67fc3caf Mon Sep 17 00:00:00 2001 From: shortcutme Date: Fri, 18 Nov 2016 20:14:58 +0100 Subject: [PATCH] Fix tag null bug --- plugins/Sidebar/media/Sidebar.coffee | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/plugins/Sidebar/media/Sidebar.coffee b/plugins/Sidebar/media/Sidebar.coffee index 9b3b7a25..c26c8008 100644 --- a/plugins/Sidebar/media/Sidebar.coffee +++ b/plugins/Sidebar/media/Sidebar.coffee @@ -230,14 +230,15 @@ class Sidebar extends Class @opened = true # Revent sidebar transitions - @tag.css("transition", "0.4s ease-out") - @tag.css("transform", "translateX(-#{targetx}px)").one transitionEnd, => - @tag.css("transition", "") - if not @opened - @container.remove() - @container = null - @tag.remove() - @tag = null + if @tag + @tag.css("transition", "0.4s ease-out") + @tag.css("transform", "translateX(-#{targetx}px)").one transitionEnd, => + @tag.css("transition", "") + if not @opened + @container.remove() + @container = null + @tag.remove() + @tag = null # Revert body transformations @log "stopdrag", "opened:", @opened @@ -265,7 +266,7 @@ class Sidebar extends Class # Database reload @tag.find("#button-dbreload").off("click").on "click", => wrapper.ws.cmd "dbReload", [], => - wrapper.notifications.add "done-dbreload", "done", "Database schema reloaded", 5000 + wrapper.notifications.add "done-dbreload", "done", "Database schema reloaded!", 5000 @updateHtmlTag() return false