Skip to content

Commit

Permalink
Merge pull request #36 from gaia-components/bug1148073
Browse files Browse the repository at this point in the history
Bug 1148073 - [gaia-icons] Check for documentElement before loading
  • Loading branch information
justindarc committed Mar 26, 2015
2 parents 0457887 + 5203118 commit f82a512
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gaia-icons",
"version": "0.7.10",
"version": "0.7.11",
"homepage": "https://github.com/wilsonpage/gaia-icons",
"authors": [
"Wilson Page <wilsonpage@me.com>"
Expand Down
13 changes: 9 additions & 4 deletions gaia-icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,19 @@ var base = window.GAIA_ICONS_BASE_URL
|| window.COMPONENTS_BASE_URL
|| 'bower_components/';

// Load it if it's not already loaded
if (!isLoaded()) { load(base + 'gaia-icons/gaia-icons.css'); }
if (!document.documentElement) {
window.addEventListener('load', load);
} else {
load();
}

function load() {
if (isLoaded()) { return; }

function load(href) {
var link = document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = href;
link.href = base + 'gaia-icons/gaia-icons.css';
document.head.appendChild(link);
exports.loaded = true;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gaia-icons",
"version": "0.7.10",
"version": "0.7.11",
"main": "gaia-icons.js",
"scripts": {
"gh-pages": "git push upstream master:gh-pages"
Expand Down

0 comments on commit f82a512

Please sign in to comment.