update resize logic
fixes #43 tested with IE11,Edge,Chrome 64,Firefox 58,Safari 11,Opera 46
This commit is contained in:
parent
d456a180d9
commit
d3bf809f75
4 changed files with 37 additions and 62 deletions
|
@ -131,12 +131,10 @@ term.open(terminalContainer)
|
|||
term.focus()
|
||||
term.fit()
|
||||
|
||||
document.body.onresize = function () {
|
||||
window.addEventListener('resize', resizeScreen, false)
|
||||
|
||||
function resizeScreen () {
|
||||
term.fit()
|
||||
term.resize(term.cols, term.rows)
|
||||
console.log('document resize...')
|
||||
console.log('geometry cols: ' + term.cols + ' rows: ' + term.rows)
|
||||
socket.emit('resize', {cols: term.cols, rows: term.rows})
|
||||
}
|
||||
|
||||
if (document.location.pathname) {
|
||||
|
|
|
@ -131,7 +131,6 @@ body {
|
|||
height: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#header {
|
||||
color: rgb(240, 240, 240);
|
||||
background-color: rgb(0, 128, 0);
|
||||
|
@ -143,40 +142,38 @@ body {
|
|||
flex: 0 1 auto;
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
.box {
|
||||
display: flex;
|
||||
flex-flow: column;
|
||||
height: 100%;
|
||||
display: block;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#terminal-container {
|
||||
flex: 1 1 auto;
|
||||
display: block;
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
padding: 2px;
|
||||
height: calc(100% - 19px);
|
||||
}
|
||||
|
||||
#terminal-container .terminal {
|
||||
background-color: #000000;
|
||||
color: #fafafa;
|
||||
padding: 2px;
|
||||
height: calc(100% - 19px);
|
||||
}
|
||||
|
||||
#terminal-container .terminal:focus .terminal-cursor {
|
||||
background-color: #fafafa;
|
||||
}
|
||||
|
||||
#bottomdiv {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
background-color: rgb(50, 50, 50);
|
||||
border-color: white;
|
||||
border-style: solid none none none;
|
||||
border-width: 1px;
|
||||
z-index: 99;
|
||||
flex: 0 1 30px;
|
||||
height: 19px;
|
||||
}
|
||||
|
||||
#footer {
|
||||
display: inline-block;
|
||||
color: rgb(240, 240, 240);
|
||||
|
@ -188,7 +185,6 @@ body {
|
|||
border-width: 1px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#status {
|
||||
display: inline-block;
|
||||
color: rgb(240, 240, 240);
|
||||
|
@ -201,51 +197,44 @@ body {
|
|||
text-align: left;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
#menu {
|
||||
display: inline-block;
|
||||
font-size:16px;
|
||||
font-size: 16px;
|
||||
color: rgb(255, 255, 255);
|
||||
padding-left: 10px;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
#menu:hover .dropup-content {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.dropup {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.dropup-content {
|
||||
display: none;
|
||||
position: absolute;
|
||||
background-color: #f1f1f1;
|
||||
font-size:16px;
|
||||
font-size: 16px;
|
||||
min-width: 160px;
|
||||
bottom:18px;
|
||||
bottom: 18px;
|
||||
z-index: 101;
|
||||
}
|
||||
|
||||
.dropup-content a {
|
||||
color: #777;
|
||||
padding: 12px 16px;
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.dropup-content a:hover {background-color: #ccc}
|
||||
|
||||
.dropup-content a:hover {
|
||||
background-color: #ccc
|
||||
}
|
||||
.dropup:hover .dropup-content {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.dropup:click .dropup-content {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.dropup:hover .dropbtn {
|
||||
background-color: #3e8e41;
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@ body {
|
|||
height: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#header {
|
||||
color: rgb(240, 240, 240);
|
||||
background-color: rgb(0, 128, 0);
|
||||
|
@ -19,40 +18,38 @@ body {
|
|||
flex: 0 1 auto;
|
||||
z-index: 99;
|
||||
}
|
||||
|
||||
.box {
|
||||
display: flex;
|
||||
flex-flow: column;
|
||||
height: 100%;
|
||||
display: block;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#terminal-container {
|
||||
flex: 1 1 auto;
|
||||
display: block;
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
padding: 2px;
|
||||
height: calc(100% - 19px);
|
||||
}
|
||||
|
||||
#terminal-container .terminal {
|
||||
background-color: #000000;
|
||||
color: #fafafa;
|
||||
padding: 2px;
|
||||
height: calc(100% - 19px);
|
||||
}
|
||||
|
||||
#terminal-container .terminal:focus .terminal-cursor {
|
||||
background-color: #fafafa;
|
||||
}
|
||||
|
||||
#bottomdiv {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
background-color: rgb(50, 50, 50);
|
||||
border-color: white;
|
||||
border-style: solid none none none;
|
||||
border-width: 1px;
|
||||
z-index: 99;
|
||||
flex: 0 1 30px;
|
||||
height: 19px;
|
||||
}
|
||||
|
||||
#footer {
|
||||
display: inline-block;
|
||||
color: rgb(240, 240, 240);
|
||||
|
@ -64,7 +61,6 @@ body {
|
|||
border-width: 1px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#status {
|
||||
display: inline-block;
|
||||
color: rgb(240, 240, 240);
|
||||
|
@ -77,51 +73,44 @@ body {
|
|||
text-align: left;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
#menu {
|
||||
display: inline-block;
|
||||
font-size:16px;
|
||||
font-size: 16px;
|
||||
color: rgb(255, 255, 255);
|
||||
padding-left: 10px;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
#menu:hover .dropup-content {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.dropup {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.dropup-content {
|
||||
display: none;
|
||||
position: absolute;
|
||||
background-color: #f1f1f1;
|
||||
font-size:16px;
|
||||
font-size: 16px;
|
||||
min-width: 160px;
|
||||
bottom:18px;
|
||||
bottom: 18px;
|
||||
z-index: 101;
|
||||
}
|
||||
|
||||
.dropup-content a {
|
||||
color: #777;
|
||||
padding: 12px 16px;
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.dropup-content a:hover {background-color: #ccc}
|
||||
|
||||
.dropup-content a:hover {
|
||||
background-color: #ccc
|
||||
}
|
||||
.dropup:hover .dropup-content {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.dropup:click .dropup-content {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.dropup:hover .dropbtn {
|
||||
background-color: #3e8e41;
|
||||
}
|
||||
|
|
|
@ -43,12 +43,11 @@ term.open(terminalContainer)
|
|||
term.focus()
|
||||
term.fit()
|
||||
|
||||
document.body.onresize = function () {
|
||||
window.addEventListener('resize', resizeScreen, false)
|
||||
|
||||
function resizeScreen () {
|
||||
term.fit()
|
||||
term.resize(term.cols, term.rows)
|
||||
console.log('document resize...')
|
||||
console.log('geometry cols: ' + term.cols + ' rows: ' + term.rows)
|
||||
socket.emit('resize', {cols: term.cols, rows: term.rows})
|
||||
socket.emit('resize', {cols: term.cols, rows: term.rows })
|
||||
}
|
||||
|
||||
if (document.location.pathname) {
|
||||
|
|
Loading…
Reference in a new issue