Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
L
luna
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
luna
Commits
0f0f1fd8
Commit
0f0f1fd8
authored
Dec 23, 2017
by
liuzheng712
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update the resize
parent
aaf2db90
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
4 deletions
+38
-4
json.component.css
src/app/replay-page/json/json.component.css
+21
-1
json.component.ts
src/app/replay-page/json/json.component.ts
+17
-3
No files found.
src/app/replay-page/json/json.component.css
View file @
0f0f1fd8
#term
{
padding
:
20px
;
width
:
100%
;
height
:
100%
;
padding
:
15px
;
}
#term
>
div
{
height
:
100%
;
}
.terminal
{
border
:
#000
solid
5px
;
color
:
#f0f0f0
;
box-shadow
:
rgba
(
0
,
0
,
0
,
0.8
)
2px
2px
20px
;
white-space
:
nowrap
;
display
:
inline-block
;
height
:
100%
;
}
#term
.terminal
div
span
{
min-width
:
12px
;
}
src/app/replay-page/json/json.component.ts
View file @
0f0f1fd8
...
...
@@ -22,18 +22,32 @@ export class JsonComponent implements OnInit {
pos
=
0
;
scrubber
:
number
;
// Todo: initial the term size
constructor
()
{
}
ngOnInit
()
{
let
col
=
Math
.
floor
(
jQuery
(
'#term'
).
width
()
/
jQuery
(
'#liuzheng'
).
width
()
*
8
)
-
3
;
let
row
=
Math
.
floor
(
jQuery
(
'#term'
).
height
()
/
jQuery
(
'#liuzheng'
).
height
())
-
5
;
this
.
term
=
new
Terminal
({
cols
:
'180'
,
rows
:
'35'
,
cols
:
col
,
rows
:
row
,
useStyle
:
true
,
screenKeys
:
true
,
});
this
.
term
.
open
(
document
.
getElementById
(
'term'
),
true
);
const
that
=
this
;
window
.
onresize
=
function
()
{
let
col
=
Math
.
floor
(
jQuery
(
'#term'
).
width
()
/
jQuery
(
'#liuzheng'
).
width
()
*
8
)
-
3
;
let
row
=
Math
.
floor
(
jQuery
(
'#term'
).
height
()
/
jQuery
(
'#liuzheng'
).
height
())
-
5
;
if
(
col
<
80
)
{
col
=
80
;
}
if
(
row
<
24
)
{
row
=
24
;
}
that
.
term
.
resize
(
col
,
row
);
};
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment