commit 5daca37f5cb1d72c50c397780b3d89d146af64c1
parent 8fce3db5d219e2d851ddd58667e3363f6aba9b97
Author: Sheng <webmaster0115@gmail.com>
Date: Sat, 22 Jun 2019 13:35:30 +0800
Edge doesn't support document fonts
Diffstat:
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/webssh/static/js/main.js b/webssh/static/js/main.js
@@ -43,7 +43,7 @@ jQuery(function($){
title_element = document.querySelector('title'),
form_id = '#connect',
debug = document.querySelector(form_id).noValidate,
- custom_font = document.fonts.values().next().value,
+ custom_font = document.fonts ? document.fonts.values().next().value : undefined,
default_fonts,
DISCONNECTED = 0,
CONNECTING = 1,
@@ -739,13 +739,15 @@ jQuery(function($){
window.Terminal.applyAddon(window.fullscreen);
}
- document.fonts.ready.then(
- function () {
- if (custom_font_is_loaded() === false) {
- document.body.style.fontFamily = custom_font.family;
+ if (document.fonts) {
+ document.fonts.ready.then(
+ function () {
+ if (custom_font_is_loaded() === false) {
+ document.body.style.fontFamily = custom_font.family;
+ }
}
- }
- );
+ );
+ }
restore_items(fields);