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
+1
View File
@@ -40,6 +40,7 @@ body {
flex: 0 0 50px; flex: 0 0 50px;
flex-direction: row-reverse; flex-direction: row-reverse;
align-items: center; align-items: center;
user-select: none;
} }
.menubar select { .menubar select {
+3 -3
View File
@@ -44,9 +44,9 @@ class TabbedEditor extends Component {
// remove this for xml/css (?) // remove this for xml/css (?)
this.editor.session.setOption("useWorker", false); this.editor.session.setOption("useWorker", false);
this.editor.setValue(this.props[this.state.currentTab], -1); 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.setTheme("ace/theme/monokai");
this.editor.session.setMode("ace/mode/javascript"); this.editor.session.setMode(MODES[this.state.currentTab]);
this.editor.on("blur", () => { this.editor.on("blur", () => {
const editorValue = this.editor.getValue(); const editorValue = this.editor.getValue();
const propsValue = this.props[this.state.currentTab]; const propsValue = this.props[this.state.currentTab];
@@ -129,7 +129,7 @@ const TEMPLATE = `
<t t-else="1"> <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"/> <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"/> <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> </t>
</div> </div>
<div class="separator vertical" t-on-mousedown="onMouseDown"/> <div class="separator vertical" t-on-mousedown="onMouseDown"/>