         super
         this._tabs = []
         this._keys = []
+        this._selectedIndex = -1
 
       add: (key, options) ->
         self = this

        super(options)
        this._tabBar = tabBar
        this._key = key

      end: -> this._tabBar

      select: ->
        cls = this.constructor
        self = this
        self.element.addClass(cls.cssClass("selected"))
        self.emit("select")

      unselect: ->
        cls = this.constructor
        self = this
        self.element.removeClass(cls.cssClass("selected"))
        self.emit("unselect")

      onclick: ->

      select: (key) ->
        self = this
        index = array.indexOf(self._keys, key)
        self._selectedIndex = index
        for tab, i in self._tabs
          if i == index then tab.select() else tab.unselect()
        self.emit("select", [key])
