     if($.browser.mozilla || $.browser.opera ||$.browser.msie )
       ce.find("br").replaceWith("\n")
 
-    PageApp.model.set({
-      name: $("#pagenameinput").val(),
-      content: ce.text()
-    })
-    PageApp.model.url = ()-> return $("#contents").attr("action")
-    PageApp.model.save()
+    @setState({content: ce.text()}, -> @submitPage())
+  handleTitleChange: (title) ->
+    @setState({title: title})
+  handleTitleSubmit: (title) ->
+    @setState({title: title}, -> @submitPage())
   render: ->
     <div>
-      <PageTitle />
+      <div className="row">
+        <div className="small-12 column">
+          <PageTitle onTitleChange={@handleTitleChange} onTitleSubmit={@handleTitleSubmit} />
+        </div>
+      </div>
       <div className="row">
         <div className="small-12 column">
           <PageContent ref="content" />

    {content: page.content}
  componentDidMount: ->
    @focus()
    document.body.addEventListener('click', @focus)
  componentWillUnmount: ->
    document.body.removeEventListener('click', @focus)
  focus: ->
    @refs.editable.getDOMNode().focus()
  render: ->

      .append $("<a></a>")
      .text(JSON.parse(recentPage).name)

App = React.createClass(
  getInitialState: ->
    {
      title: page.name
      content: page.content
    }
  submitPage: ->
    PageApp.model.set({
      name: @state.title
      content: @state.content
    })
    PageApp.model.url = ()-> return $("#contents").attr("action")
    PageApp.model.save()
  handlePageSubmit: ->
    ce = $("<pre />").html(React.findDOMNode(@refs.content).innerHTML)
    if($.browser.webkit)
