PROD-2144
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
<%! from django.utils.translation import ugettext as _ %>
|
||||
<%page args="tabName"/>
|
||||
<%page args="tabName" expression_filter="h"/>
|
||||
<div>
|
||||
<textarea id="xml-${html_id}" class="edit-box">${data | h}</textarea>
|
||||
<textarea id="xml-${html_id}" class="edit-box">${data}</textarea>
|
||||
</div>
|
||||
|
||||
<script type='text/javascript'>
|
||||
require(["domReady!", "jquery", "codemirror"], function(doc, $, CodeMirror) {
|
||||
## Init CodeMirror editor
|
||||
var el = $("#xml-${html_id}"),
|
||||
var el = $("#xml-${html_id|n, decode.utf8}"),
|
||||
xml_editor = CodeMirror.fromTextArea(el.get(0), {
|
||||
mode: "application/xml",
|
||||
lineNumbers: true,
|
||||
@@ -15,13 +15,13 @@ require(["domReady!", "jquery", "codemirror"], function(doc, $, CodeMirror) {
|
||||
});
|
||||
|
||||
TabsEditingDescriptor.Model.addModelUpdate(
|
||||
'${html_id}',
|
||||
'${tabName}',
|
||||
'${html_id|n, decode.utf8}',
|
||||
'${tabName|n, decode.utf8}',
|
||||
function() { return xml_editor.getValue(); })
|
||||
|
||||
TabsEditingDescriptor.Model.addOnSwitch(
|
||||
'${html_id}',
|
||||
'${tabName}',
|
||||
'${html_id|n, decode.utf8}',
|
||||
'${tabName|n, decode.utf8}',
|
||||
function(){
|
||||
## CodeMirror should get focus when tab is active
|
||||
xml_editor.refresh();
|
||||
|
||||
Reference in New Issue
Block a user