diff --git a/src/app.js b/src/app.js index b3a4a55070..70d7c3e947 100644 --- a/src/app.js +++ b/src/app.js @@ -170,7 +170,7 @@ class App extends ApiFactory { init () { var self = this - self._components.resizeFeature = new PanelsResize('#swap-panel', '#editor-container', { 'minWidth': 400, x: 450 }) + self._components.resizeFeature = new PanelsResize('#swap-panel', '#editor-container', { 'minWidth': 300, x: 300 }) run.apply(self) } diff --git a/src/app/panels/editor-panel.js b/src/app/panels/editor-panel.js index 7dd6652f67..91c4810042 100644 --- a/src/app/panels/editor-panel.js +++ b/src/app/panels/editor-panel.js @@ -79,10 +79,9 @@ class EditorPanel { self._view.mainPanel.style.display = 'none' }) self.data = { - _FILE_SCROLL_DELTA: 200, _layout: { top: { - offset: self._deps.config.get('terminal-top-offset') || 500, + offset: self._deps.config.get('terminal-top-offset') || 150, show: true } } @@ -104,7 +103,7 @@ class EditorPanel { var height = window.innerHeight var newpos = (event.pageY < limitUp) ? limitUp : event.pageY newpos = (newpos < height - limitDown) ? newpos : height - limitDown - return newpos + return height - newpos } }) @@ -138,11 +137,11 @@ class EditorPanel { var tmp = delta - limitDown delta = tmp > 0 ? tmp : 0 if (direction === 'top') { - var height = containerHeight - delta - height = height < 0 ? 0 : height - self._view.editor.style.height = `${delta}px` - self._view.mainPanel.style.height = `${delta}px` - self._view.terminal.style.height = `${height}px` // - menu bar height + var mainPanelHeight = containerHeight - delta + mainPanelHeight = mainPanelHeight < 0 ? 0 : mainPanelHeight + self._view.editor.style.height = `${mainPanelHeight}px` + self._view.mainPanel.style.height = `${mainPanelHeight}px` + self._view.terminal.style.height = `${delta}px` // - menu bar height self._components.editor.resize((document.querySelector('#editorWrap') || {}).checked) self._components.terminal.scroll2bottom() } diff --git a/src/app/panels/terminal.js b/src/app/panels/terminal.js index 808fd912f7..23a07de478 100644 --- a/src/app/panels/terminal.js +++ b/src/app/panels/terminal.js @@ -104,12 +104,17 @@ class Terminal { if (opts.shell) self._shell = opts.shell register(self) } + + focus () { + if (this._view.input) this._view.input.focus() + } + render () { var self = this if (self._view.el) return self._view.el self._view.journal = yo`
` self._view.input = yo` - + { this.focus() }} contenteditable="true" onpaste=${paste} onkeydown=${change}> ` self._view.input.innerText = '\n' self._view.cli = yo` diff --git a/src/app/staticanalysis/staticAnalysisView.js b/src/app/staticanalysis/staticAnalysisView.js index 699387b61a..d8ce2c2fb5 100644 --- a/src/app/staticanalysis/staticAnalysisView.js +++ b/src/app/staticanalysis/staticAnalysisView.js @@ -43,32 +43,34 @@ staticAnalysisView.prototype.render = function () { var self = this var view = yo`