     @clean
 
   viewAppended:->
-    @addSubView @viewerHeader = new ViewerTopBar {}, @path
-    @addSubView @iframe = new KDCustomHTMLView
-      tagName : 'iframe'
+    @addSubView @viewerHeader = new ViewerTopBar     { delegate: this }, @path
+    @addSubView @iframe       = new KDCustomHTMLView { tagName : "iframe" }
 
-    {path} = @getOption 'params'
+    {params} = @getOptions()
+    path     = params?.path
     if path then @utils.defer => @openPath path

    @path = path
    @iframe.$().attr 'src', path
    @viewerHeader.setPath initialPath

  refreshIFrame:->
    @iframe.$().attr 'src', "#{@path}"

class PreviewerView extends KDView

  constructor:(options = {},data)->

    options.cssClass = 'previewer-body'

    super options, data

  openPath:(path)->
