From f931f5f5ce1f2936098f23b3100531da58aea919 Mon Sep 17 00:00:00 2001 From: James Allen Date: Wed, 9 Apr 2014 15:57:27 +0100 Subject: [PATCH] Only show if sidebar is open and meant to be shown --- .../public/coffee/pdf/SyncButtonsView.coffee | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/services/web/public/coffee/pdf/SyncButtonsView.coffee b/services/web/public/coffee/pdf/SyncButtonsView.coffee index c7b2c3f55f..0f8de8690f 100644 --- a/services/web/public/coffee/pdf/SyncButtonsView.coffee +++ b/services/web/public/coffee/pdf/SyncButtonsView.coffee @@ -44,20 +44,24 @@ define [ ### return @ - hide: () -> @$el.hide() + hide: () -> + @hidden = true + @$el.hide() show: () -> + @hidden = false + @showIfNotHiddenAndOpen() + + showIfNotHiddenAndOpen: () -> state = @ide.editor.$splitter.layout().readState() - if !state.east?.initClosed + if !@hidden and !state.east?.initClosed @$el.show() + else + @$el.hide() repositionLeft: () -> state = @ide.editor.$splitter.layout().readState() if state.east? @$el.css({right: state.east.size - 8}) - if state.east.initClosed - @hide() - else - @show() - + @showIfNotHiddenAndOpen();