     # Create a ReactiveVar that tracks the docId that was passed in
     docIdVar = new Blaze.ReactiveVar
 
-    parentView.onRendered ->
+    parentView.onViewReady ->
       this.autorun ->
-        data = Blaze.getCurrentData()
+        data = Template.currentData()
         docIdVar.set(data.docid)
 
-    parentView.onDestroyed =>
+    parentView.onViewDestroyed =>
       this.destroy()
 
     @isCreated = false

    # Meteor._debug "destroying textarea editor"
    @textarea = null

UI.registerHelper "sharejsAce", Template.__create__('sharejsAce', ->
  return new ShareJSAceConnector(this).create()
)

UI.registerHelper "sharejsText", Template.__create__('sharejsText', ->
  return new ShareJSTextConnector(this).create()
)

    @isCreated = true

    @view = @createView()
    @view.onViewReady ->
      connector.rendered( this._domrange.firstNode() )

      this.autorun ->
        # By grabbing docId here, we ensure that we only try to connect when
