     @path = path
     @iframe.$().attr 'src', path
     @viewerHeader.setPath initialPath
+    @emit "ready"
 
   refreshIFrame:->
     @iframe.$().attr 'src', "#{@path}"

class PreviewerView extends KDView

  constructor:(options = {},data)->
    options.cssClass = 'previewer-body'
    super options, data

  openPath:(path)->

    @clean

  viewAppended:->
    @addSubView @viewerHeader = new ViewerTopBar     { delegate: this }, @path
    @addSubView @iframe       = new KDCustomHTMLView { tagName : "iframe" }

    {params} = @getOptions()
    path     = params?.path
    if path then @utils.defer => @openPath path
