lib/assets/javascripts/tao/ui/shared/slide_box/element/base.coffee in tao_ui-0.2.5 vs lib/assets/javascripts/tao/ui/shared/slide_box/element/base.coffee in tao_ui-0.2.6

- old
+ new

@@ -49,15 +49,22 @@ _beforeActiveChanged: (active) -> if active @jq.show() @reflow() else + reset = => + if @autoDestroy + @remove() + else + @jq.hide() + + # in case the slide box is hidden too fast if @jq.is(':visible') - @one 'transitionend', => - if @autoDestroy - @remove() - else - @jq.hide() + if @jq.css('opacity') * 1 == 0 + reset() + else + @one 'transitionend', -> + reset() null _activeChanged: -> @_unbindAutoHideEvent() if @autoHide if @active