X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/76a7781f806775f0b29c50ab8937e4dd64807830..1fc8724242d7f5bbba51812a118d86aead57f32b:/project/templates/explorer/panels/xmleditor.html?ds=sidebyside diff --git a/project/templates/explorer/panels/xmleditor.html b/project/templates/explorer/panels/xmleditor.html index f2a6d733..0c8724fd 100644 --- a/project/templates/explorer/panels/xmleditor.html +++ b/project/templates/explorer/panels/xmleditor.html @@ -15,7 +15,10 @@ path: "/static/js/codemirror/", stylesheet: "/static/css/xmlcolors.css", parserConfig: {useHTMLKludges: false}, - initCallback: function() { + onChange: function() { + $(document).trigger('panel:contentChanged', panel); + }, + initCallback: function(editor) { // Toolbar $('.toolbar-tabs li', panel).click(function() { var id = $(this).attr('p:button-list'); @@ -32,12 +35,12 @@ var tag = $(this).attr('p:tag'); var handler = function() { var text = editor.selection(); - console.log(editor, editor.frame); editor.replaceSelection('<' + tag + '>' + text + ''); if (text.length == 0) { var pos = editor.cursorPosition(); editor.selectLines(pos.line, pos.character + tag.length + 2); } + $(document).trigger('panel:contentChanged', panel); } if ($(this).attr('p:key')) { keys[$(this).attr('p:key')] = handler;