   updateStylesheet = (selector, property, value) ->
     sheet = getStylesheet().sheet
     sheet.insertRule "#{selector} { #{property}: #{value}; }", sheet.cssRules.length
+
+  calculateHideDuration = (delay) ->
+    delay ?= atom.config.get 'autohide-tree-view.hideDelay'
+    hideDuration = if delay is 0 then 0 else .05 + delay
 
   config:
     unfoldSpeed:

      stylesheet = null

  applyUnfoldSpeed: (speed) ->
    unless hideDuration?
      hideDelay = atom.config.get 'autohide-tree-view.hideDelay'
      hideDuration = if hideDelay is 0 then 0 else .05 + hideDelay
    maxWidth = Math.max 2500, 1000 * speed * hideDuration
    updateStylesheet '.tree-view-resizer:hover', 'max-width', "#{maxWidth}px!important"

  applyHideDelay: (delay) ->
    hideDuration = duration = if delay is 0 then 0 else delay + .05
    updateStylesheet '.tree-view-resizer', 'transition-duration', "#{duration}s"

  applyMinWidth: (width) ->

'use strict'
class AutohideTreeView
  hideDuration = null # cache hideDuration value
  stylesheet = null # this holds the configurable css rules

  getStylesheet = ->
    return stylesheet if stylesheet?
