 		switch e.keyCode
 			when 49
 				if @status.cmd or @status.ctrl
-					@toggleFormatBlock 'h1'
+					@toggleFormatBlock @getSelectedElement(), 'h1'
 					e.preventDefault()
 					e.stopPropagation()
 			when 50
 				if @status.cmd or @status.ctrl
-					@toggleFormatBlock 'h2'
+					@toggleFormatBlock @getSelectedElement(), 'h2'
 					e.preventDefault()
 					e.stopPropagation()
 			when 51
 				if @status.cmd or @status.ctrl
-					@toggleFormatBlock 'pre'
+					@toggleFormatBlock @getSelectedElement(), 'pre'
 					e.preventDefault()
 					e.stopPropagation()
 			when 16

			height = $(@).outerHeight()
			self.showTooltip()
			self.setTooltipTop thisOffset.top - parentOffset.top
		$('body').delegate '#tooltip', 'mouseleave', (e)->
			self.hideTooltip()


		@status.titleEmpty = $('#editor-title').text() == '' || $('#editor-title').text() == @titlePromptMessage
	checkEmpty: ->
		@status.empty = $('#editor').text() == '' || $('#editor').text() == @promptMessage
	toggleFormatBlock: (jqel, tag)->
		if jqel.attr 'name'
			@saveSelection()
			if jqel.is tag
				newEl = $('<p>').html jqel.html()
				newEl.attr 'name', jqel.attr 'name'
				jqel.after(newEl)
				jqel.remove()
				@restoreSelection()
			else
				newEl = $("<#{tag}>").html jqel.html()
				newEl.attr 'name', jqel.attr 'name'
				jqel.after(newEl)
				jqel.remove()
				@restoreSelection()
		else
			document.execCommand('formatBlock', false, tag)
