Ignore invalid font size

pull/223/head
Sheng 2021-08-25 19:18:28 +08:00
parent de828cbabf
commit ddbb2c3fb1
1 changed files with 7 additions and 2 deletions

View File

@ -361,13 +361,18 @@ jQuery(function($){
decoder = window.TextDecoder ? new window.TextDecoder(encoding) : encoding,
terminal = document.getElementById('terminal'),
termOptions = {
cursorBlink: true,
theme: {
background: url_opts_data.bgcolor || 'black'
}
};
if (url_opts_data.fontsize !== undefined)
termOptions.fontSize = parseInt(url_opts_data.fontsize);
if (url_opts_data.fontsize) {
var fontsize = window.parseInt(url_opts_data.fontsize);
if (fontsize && fontsize > 0) {
termOptions.fontSize = fontsize;
}
}
var term = new window.Terminal(termOptions);