   onStylesheetsChanged: =>
     # If visible, force a redraw so the scrollbars are styled correctly based on
     # the theme
-    return if @element.offsetWidth is 0 and @element.offsetHeight is 0
+    return unless @isVisible()
     @element.style.display = 'none'
     @element.offsetWidth
     @element.style.display = ''

    @selectEntry(@roots[0])

    @selectEntryForPath(state.selectedPath) if state.selectedPath
    @scrollTopAfterAttach = state.scrollTop if state.scrollTop
    @scrollLeftAfterAttach = state.scrollLeft if state.scrollLeft
    @element.style.width = "#{state.width}px" if state.width > 0

    @disposables.add @onEntryMoved ({initialPath, newPath}) ->


    @disposables = new CompositeDisposable
    @emitter = new Emitter
    @roots = []
    @selectedPath = null
    @ignoredPatterns = []
    @useSyncFS = false
