 			self.showTooltip()
 			self.setTooltipTop thisOffset.top - parentOffset.top
 		.delegate '> h1,h2,p,pre,code,figure', 'mouseleave', (e)->
-			self.saveSelection()
 			self.update()
 
 		# tooltip functions

				jqel.remove()
				@restoreSelection()
			else
				console.log jqel.html()
				newEl = $("<#{tag}>").html jqel.html()
				newEl.attr 'name', jqel.attr 'name'
				newEl.attr 'class', jqel.attr 'class'
				console.log newEl.html()
				jqel.after(newEl)
				jqel.remove()
				@restoreSelection()


		$('body').delegate '#editor', 'click', (e)->
			$(@).focus()

		# toolpad
		$('body').delegate '#editor', 'mouseup', (e)=>
			sel = @selection()
			if sel.rangeCount > 0
				range = sel.getRangeAt 0
				unless range.collapsed
					@saveSelection 'm'
					@showToolpadOverSelection 'm'
					@restoreSelection 'm'

	update: ->
		self = @
