fix: 回放和录像窗口问题

修改默认窗口大小,1024x1024,外部浏览器窗口由用户自己去调节,内部DOM设置成很大
parent 69c84f7e
...@@ -21,28 +21,28 @@ export class ElementTermComponent implements OnInit, AfterViewInit { ...@@ -21,28 +21,28 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
} }
ngAfterViewInit() { ngAfterViewInit() {
term.col = Math.floor(jQuery(this.el.nativeElement).width() / jQuery('#liuzheng').width() * 8) - 3; // term.col = Math.floor(jQuery(this.el.nativeElement).width() / jQuery('#liuzheng').width() * 8) - 3;
term.row = Math.floor(jQuery(this.el.nativeElement).height() / jQuery('#liuzheng').height()) - 5; // term.row = Math.floor(jQuery(this.el.nativeElement).height() / jQuery('#liuzheng').height()) - 5;
term.term = Terminal({ term.term = Terminal({
cols: term.col, cols: 1024,
rows: term.row, rows: 1024,
useStyle: true, useStyle: true,
screenKeys: true, screenKeys: true,
}); });
term.term.open(this.el.nativeElement, true); term.term.open(this.el.nativeElement, true);
const that = this; // const that = this;
window.onresize = function () { // window.onresize = function () {
term.col = Math.floor(jQuery(that.el.nativeElement).width() / jQuery('#liuzheng').width() * 8) - 3; // term.col = Math.floor(jQuery(that.el.nativeElement).width() / jQuery('#liuzheng').width() * 8) - 3;
term.row = Math.floor(jQuery(that.el.nativeElement).height() / jQuery('#liuzheng').height()) - 5; // term.row = Math.floor(jQuery(that.el.nativeElement).height() / jQuery('#liuzheng').height()) - 5;
//
if (term.col < 80) { // if (term.col < 80) {
term.col = 80; // term.col = 80;
} // }
if (term.row < 24) { // if (term.row < 24) {
term.row = 24; // term.row = 24;
} // }
term.term.resize(term.col, term.row); // term.term.resize(term.col, term.row);
}; // };
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment