fix: a few small bugs, restore proper tab on layout change

This commit is contained in:
Géry Debongnie
2019-04-01 10:55:15 +02:00
parent cbd85f9cf3
commit 9d389d972e
2 changed files with 4 additions and 3 deletions
+3 -3
View File
@@ -44,9 +44,9 @@ class TabbedEditor extends Component {
// remove this for xml/css (?)
this.editor.session.setOption("useWorker", false);
this.editor.setValue(this.props[this.state.currentTab], -1);
this.editor.setFontSize("14px");
this.editor.setFontSize("13px");
this.editor.setTheme("ace/theme/monokai");
this.editor.session.setMode("ace/mode/javascript");
this.editor.session.setMode(MODES[this.state.currentTab]);
this.editor.on("blur", () => {
const editorValue = this.editor.getValue();
const propsValue = this.props[this.state.currentTab];
@@ -129,7 +129,7 @@ const TEMPLATE = `
<t t-else="1">
<t t-widget="TabbedEditor" t-props="{js:state.js, css:state.css, xml: state.xml, display: 'js', style:topEditorStyle}" t-on-updateCode="updateCode"/>
<div class="separator horizontal"/>
<t t-widget="TabbedEditor" t-props="{js:state.js, css:state.css, xml: state.xml, display: 'xml|css', resizeable: true}" t-on-updateCode="updateCode" t-on-updatePanelHeight="updatePanelHeight"/>
<t t-widget="TabbedEditor" t-keep-alive="1" t-props="{js:state.js, css:state.css, xml: state.xml, display: 'xml|css', resizeable: true}" t-on-updateCode="updateCode" t-on-updatePanelHeight="updatePanelHeight"/>
</t>
</div>
<div class="separator vertical" t-on-mousedown="onMouseDown"/>