Archived
0

MCSM:WebConsole: стилистические модернизации поля ввода

This commit is contained in:
2017-06-03 16:41:27 +03:00
parent 9b66cc5588
commit 80ff52b471
2 changed files with 8 additions and 2 deletions

View File

@@ -90,6 +90,9 @@ var WebConsole = React.createClass({
this.ws.close(); this.ws.close();
this.ws = null; this.ws = null;
}, },
focusInput: function() {
this.refs.input.focus();
},
/*--------------------*/ /*--------------------*/
getInitialState: function(){return{ getInitialState: function(){return{
lines: [] lines: []
@@ -104,7 +107,7 @@ var WebConsole = React.createClass({
return ce('p', {dangerouslySetInnerHTML: {__html: ansi_up.ansi_to_html(line)}}); return ce('p', {dangerouslySetInnerHTML: {__html: ansi_up.ansi_to_html(line)}});
}) })
), ),
ce('input') ce('input', {ref: 'input'})
) )
) )
}, },
@@ -117,6 +120,7 @@ var ServerInfo = React.createClass({
tabStateWebConsole: function(state) { tabStateWebConsole: function(state) {
if (state === 1) { if (state === 1) {
this.refs.webconsole.connect(); this.refs.webconsole.connect();
this.refs.webconsole.focusInput();
} }
}, },
/*--------------------*/ /*--------------------*/

View File

@@ -13,9 +13,11 @@
#webconsole input { #webconsole input {
background-color: #1e1e1e; background-color: #1e1e1e;
background-image: url('data:image/svg+xml;utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="30"><text x="7" y="24" style="font-size: 1.5em; font-family: monospace" fill="#ffffff">&gt;</text></svg>');
background-repeat: no-repeat;
color: #eee; color: #eee;
border: none; border: none;
padding: 8px; padding: 8px 8px 8px 1.5em;
width: 100%; width: 100%;
} }