 'use strict'
 class AutohideTreeView
-  hideDuration = null
-  stylesheet = null
+  hideDuration = null # cache hideDuration value
+  stylesheet = null # this holds the configurable css rules
 
   getStylesheet = ->
     return stylesheet if stylesheet?

  updateStylesheet = (selector, property, value) ->
    sheet = getStylesheet().sheet
    sheet.insertRule "#{selector} { #{property}: #{value}; }", sheet.cssRules.length

  config:
    unfoldSpeed:

      stylesheet = null

  applyUnfoldSpeed: (speed) ->
    maxWidth = Math.max 2500, 1000 * speed * calculateHideDuration()
    updateStylesheet '.tree-view-resizer:hover', 'max-width', "#{maxWidth}px!important"

  applyHideDelay: (delay) ->
    duration = calculateHideDuration()
    updateStylesheet '.tree-view-resizer', 'transition-duration', "#{duration}s"

  applyMinWidth: (width) ->
