       super
       @close()
 
+    ##
+    # @api private
+    focusReturnsTo: ->
+      return null unless @$trigger
+      if id = @$trigger.data('focusReturnsTo')
+        return $("##{id}")
+      else
+        return @$trigger

    remove: ->
      super
      @$trigger?.off '.dialogFormView'

    ##
    # lazy init on first open

      @$trigger?.on 'click.dialogFormView', preventDefault(@toggle)

    ##
    # the function to render the element.  it will either be firstRenderEl or
    # renderElAgain depending on the state of the view
    #
    # @api private
    renderEl: null

    firstRenderEl: =>
      @$el.html @wrapperTemplate @toJSON()
      @renderElAgain()
      # reassign: only render the outlout now
      @renderEl = @renderElAgain

    ##
    # @api private
    renderElAgain: =>
      html = @template @toJSON()
      @$el.find('.outlet').html html

