     @editor = new Editor model: model
     
     @editor.bind "init", =>
+      @preview.id = model.get "id"
       @preview.reload()
     
     model.bind "saved", =>

    @model.save null,
      success: (e) =>
        utils.msg.info "saved #{ @model.get "id" }"
        setTimeout =>
          @model.trigger "saved", @model
        , 1000

        if not @hasEditUrl()
          window.location.hash = "#edit/#{ @model.get("id") }"

      @editor.getSession().setValue slide.get "html"
      # console.log "changed", JSON.stringify @model.attributes

    if @model.get "id" 
      @model.fetch
        success: =>
          @trigger 'init', @

  getDocId: ->
    @model.get "id"
