diff options
-rw-r--r-- | tabs/osd.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tabs/osd.js b/tabs/osd.js index 73c57473..097e9f73 100644 --- a/tabs/osd.js +++ b/tabs/osd.js @@ -2089,10 +2089,15 @@ TABS.osd.initialize = function (callback) { // load the last selected font when we change tabs chrome.storage.local.get('osd_font', function (result) { - if (result.osd_font != undefined) - $('.fontbuttons button[data-font-file="' + result.osd_font + '"]').click() - else + if (result.osd_font != undefined) { + previous_font_button = $('.fontbuttons button[data-font-file="' + result.osd_font + '"]'); + if (previous_font_button.attr('data-font-file') == undefined) previous_font_button = undefined; + } + + if (previous_font_button == undefined) $fontPicker.first().click(); + else + previous_font_button.click(); }); $('button.load_font_file').click(function () { |