     $(@current_editor).focus();
 
   save: ->
-#    TODO: make sure this gets unregistered correctly (changed how registration works)
     $body.off('click', '.editor-tabs .tab', @changeEditor)
     data: @xml_editor.getValue()

  onMarkdownEditorUpdate:  ->
    console.log('update')

  changeEditor: (e) ->
    e.preventDefault();
    $('.editor-tabs .current').removeClass('current')
    $(this).addClass('current');
    if (@current_editor == @xml_editor)
      @setCurrentEditor(@markdown_editor)
    else

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

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