       lock '', 'Failed to load...'
 
     lock '', 'Loading...'
-    $window.off 'dblclick', startEditing
-    $window.off 'keydown', maybeCancelEditing
+    $body.off 'dblclick', startEditing
+    $body.off 'keydown', maybeCancelEditing
     $.ajax({
       url: "tastes/#{filename}"
     }).done(done).fail(fail)

    $linenosCode.html "Esc - #{metaKeyName}+s - Shift+#{metaKeyName}+s".replace /(.)/g, '$1<br>'
    $editorCode.html(content).attr('contentEditable', 'true').focus()
    $editor.addClass('editing')
    $window.off 'keydown', disableSave
    $window.on 'keydown', maybeSave

  lock = (content, lines = []) ->
    content ?= getDomContent()

$ () ->
  currentContent = ''
  $window = $ window
  $body = $ window.document.body
  $style = $ '#style'
  $selectedStyle = $ '#selectedStyle'
  $linenos = $ '#linenos'
