   hide: (noDelay) ->
     return unless @enabled
     @applyDoAnimate()
-    transitionDelay = !noDelay * @getHideDelay()
+    transitionDelay = !noDelay * @getSetting 'hideDelay'
     treeViewEl.classList.remove 'autohide-unfolded'
     treeViewEl.style.transitionDelay = "#{transitionDelay}s"
     @applyHiddenWidth()

    @applyHiddenWidth()
    @applyDoAnimate()
    width = treeViewEl.querySelector('.tree-view').clientWidth
    if width > treeViewEl.clientWidth > @getHiddenWidth()
      noDelay = true
    transitionDelay = !noDelay * @getShowDelay()
    treeViewEl.classList.add 'autohide-unfolded'
    treeViewEl.style.transitionDelay = "#{transitionDelay}s"
    treeViewEl.style.width = "#{width}px"


  applyDoAnimate: (doAnimate) ->
    return unless @enabled
    doAnimate = doAnimate?.newValue ? @getSetting 'animate'
    treeViewEl.style.transitionDuration = "#{!!doAnimate * .3}s"

  applyHiddenWidth: (width) ->
    return unless @enabled
    width = @getSetting 'hiddenWidth' if isNaN parseInt width
    treeViewEl.style.width = "#{width}px"
    treeViewEl.parentNode.style?.width = "#{width}px" unless @getSetting 'pushEditor'

  applyPushEditor: (pushEditor) ->
    return unless @enabled
    if pushEditor
      treeViewEl.style.position = 'relative'
      treeViewEl.parentNode.style?.width = ''
    else
      treeViewEl.style.position = 'absolute'
      treeViewEl.parentNode.style?.width = "#{@getSetting 'hiddenWidth'}px"

  getSetting: (setting) -> atom.config.get "autohide-tree-view.#{setting}"

  enableHoverEvents: -> treeViewEl.classList.add 'autohide-hover-events'

