Skip to content

Commit

Permalink
Defer the loading of personalize.js, and ensure that personalize is c…
Browse files Browse the repository at this point in the history
…alled

even if the DOM was loaded before this script runs.
  • Loading branch information
rubys committed Sep 18, 2010
1 parent 4aa9087 commit d4c4fa9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion themes/asf/index.html.xslt
Expand Up @@ -25,7 +25,7 @@
title="{atom:title}" type="{atom:link[@rel='self']/@type}" />
</xsl:if>
<link rel="shortcut icon" href="/favicon.ico" />
<script type="text/javascript" src="personalize.js">
<script defer="defer" src="personalize.js">
<xsl:comment><!--HTML Compatibility--></xsl:comment>
</script>
</head>
Expand Down
6 changes: 5 additions & 1 deletion themes/asf/personalize.js
Expand Up @@ -294,4 +294,8 @@ function personalize() {
}

// hook event
document.addEventListener("DOMContentLoaded", personalize, false);
if (document.getElementById('footer')) {
personalize();
} else {
document.addEventListener("DOMContentLoaded", personalize, false);
}

0 comments on commit d4c4fa9

Please sign in to comment.