       @views ?= []
       @views.push(view)
       view.setElement($("<#{type}>").appendTo(@$el)).render()
+      view.onShow()
 
     empty: () ->
       _.each @views, (view) ->

      @_renderDom(data)

    render: () ->
      @onBeforeRender?()
      @_render()
      @onRender?()
      if @_rendered then @onDomRefresh?() else @_rendered = true

      return @

    close: () ->
      @onBeforeClose?()

      _.each @regions, (region) ->
        region.close()

      @remove()
      @unbind()
      delete @[key] for key of @
      return @


    close: () ->
      @empty()
      cleanObject()

  class Regions
    constructor: (regions = {}, $context) ->
