 
   save: ->
     $body.off('click', '.editor-tabs .tab', @changeEditor)
+    $body.off('click', '.editor-bar a', @onToolbarButton);
     data: @xml_editor.getValue()
 
   @markdownToXml: (markdown)->

      @setCurrentEditor(@xml_editor)
      @xml_editor.setValue(MarkdownEditingDescriptor.markdownToXml(@markdown_editor.getValue()))

  setCurrentEditor: (editor) ->
    $(@current_editor.getWrapperElement()).hide()
    @current_editor = editor

class @MarkdownEditingDescriptor extends XModule.Descriptor
  constructor: (element) ->
    $body.on('click', '.editor-tabs .tab', @changeEditor)
    $body.on('click', '.editor-bar a', @onToolbarButton);

    @xml_editor = CodeMirror.fromTextArea($(".xml-box", element)[0], {
    mode: "xml"
