 			@handleKeyDown(e)
 			@update()
 		.on 'keyup', (e)=>
-			@detectChanged()
+			@detectContentsChanged()
 			@handleKeyUp(e)
 			@update()
 			@checkEmpty()

			$(@).after(el)
			$(@).remove()
		@restoreSelection()
	detectChanged: ->
			title = $('#editor-title').html()
			content = $('#editor').html()
			if @lastTitle != title || @lastContent != content
				@setChanged true
				@lastTitle = title
				@lastContent = content

	

	autosave: (durationInMilliseconds=5000)->
		(update= =>

		$('#editor-title').on 'keydown', (e)=>
			@handleTitleKeyDown(e)
		.on 'keyup', (e)=>
			@detectContentsChanged()
			@handleTitleKeyUp(e)
		.on 'paste', (e)=>
			self = @
