 
 module.exports = class JTreeView extends KDListView
 
-  constructor:(options = {},data)->
+  constructor:(options = {}, data)->
 
     options.animated ?= no
+    options.cssClass  = KD.utils.curry 'jtreeview expanded', options.cssClass
+
     super options, data
-    @setClass "jtreeview expanded"
+
 
   toggle:(callback)->
 
     if @expanded then @collapse callback else @expand callback
+
 
   expand:(callback)->
 

      @unsetClass "expanded"
      callback?()

  mouseDown:->

    KD.getSingleton("windowController").setKeyView @
    no

  keyDown:(event)->

    @emit "KeyDownOnTreeView", event

  destroy:->

    KD.getSingleton("windowController").revertKeyView @

    super

      @setClass "expanded"
      callback?()


  collapse:(callback)->

    if @getOptions().animated
