Changed to find the custom font to use

pull/310/head
Ben C 2022-11-30 02:46:42 -05:00
parent 04bd859f15
commit 66a0922788
2 changed files with 15 additions and 2 deletions

View File

@ -34,6 +34,17 @@ var wssh = {};
}
}());
const findFont = (iterator, familyName) => {
if (iterator === undefined) {
return undefined;
}
while (iterator.next()) {
if (iterator.family() === familyName) {
return iterator;
}
}
return undefined;
}
jQuery(function($){
var status = $('#status'),
@ -46,7 +57,9 @@ jQuery(function($){
title_element = document.querySelector('title'),
form_id = '#connect',
debug = document.querySelector(form_id).noValidate,
custom_font = document.fonts ? document.fonts.values().next().value : undefined,
fonts = document.fonts;
custom_font_family_name = $("body").attr("data-wssh-custom-font-family-name", "");
custom_font = findFont(fonts, custom_font_family_name),
default_fonts,
DISCONNECTED = 0,
CONNECTING = 1,

View File

@ -36,7 +36,7 @@
{% end %}
</style>
</head>
<body>
<body {% if font.family %}data-wssh-custom-font-family-name="{{ font.family }}"{% end %}>
<div id="waiter" style="display: none"> Connecting ... </div>
<div class="container form-container" style="display: none">