mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Added deferred loading of Roboto font.
With Polymer, putting it in the head hides the UI until the font is loaded, which can take a few seconds on slower connections. By loading it in JS, the UI font gets "upgraded" while the initialisation process occurs. Closes #333.
This commit is contained in:
@@ -1260,6 +1260,13 @@ window.addEventListener('polymer-ready', function(e) {
|
||||
/* Set the plugin list's scroll target to its parent. */
|
||||
document.getElementById('main').lastElementChild.scrollTarget = document.getElementById('main');
|
||||
|
||||
/* Add Roboto font loader. */
|
||||
var link = document.createElement('link');
|
||||
link.href = 'http://fonts.googleapis.com/css?family=RobotoDraft:regular,bold,italic,thin,light,bolditalic,black,medium&lang=en';
|
||||
link.rel = 'stylesheet';
|
||||
link.type = 'text/css';
|
||||
document.head.appendChild(link);
|
||||
|
||||
require(['bower_components/marked/lib/marked', 'js/l10n', 'js/plugin', 'js/filters'], function(markedResponse, l10nResponse) {
|
||||
marked = markedResponse;
|
||||
l10n = l10nResponse;
|
||||
|
||||
Reference in New Issue
Block a user