diff options
author | Michel Pastor <shellixyz@gmail.com> | 2018-12-18 02:08:35 +0300 |
---|---|---|
committer | Michel Pastor <shellixyz@gmail.com> | 2018-12-18 02:08:35 +0300 |
commit | 2b97becbab54748db4c46c7c2263eaf07493e95e (patch) | |
tree | 289e5715c59bfe3d182337caa9daac4a62ee9b78 | |
parent | efa226da3240195799c0ff409ab51e4a6fd6e2e9 (diff) |
Use the last selected font for the OSD preview
-rw-r--r-- | tabs/osd.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tabs/osd.js b/tabs/osd.js index a7355433..b364d7f0 100644 --- a/tabs/osd.js +++ b/tabs/osd.js @@ -2028,10 +2028,16 @@ TABS.osd.initialize = function (callback) { FONT.preview($preview); OSD.GUI.update(); }); + chrome.storage.local.set({'osd_font': $(this).data('font-file')}); }); - // load the first font when we change tabs - $fontPicker.first().click(); + // 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 + $fontPicker.first().click(); + }); $('button.load_font_file').click(function () { $fontPicker.removeClass('active'); |