Skip to content
Browse files

init sidebar before images are loaded (if supported)

  • Loading branch information...
1 parent fdd0107 commit fe942d946ca88497020eb0cb5652f383f6ebfb51 @hhelwich hhelwich committed Mar 8, 2014
Showing with 9 additions and 2 deletions.
  1. +9 −2 res/script.js
View
11 res/script.js
@@ -210,7 +210,13 @@ function switchTab(tab){
*
* When the document is ready, make the sidebar and all that jazz
*/
-window.onload = function(){
+(function (init) {
+ if (window.addEventListener) {
+ window.addEventListener('DOMContentLoaded', init);
+ } else { // IE8 and below
+ window.onload = init;
+ }
+}(function(){
makeTree(tree, relativeDir, thisFile);
wireUpTabs();
@@ -220,4 +226,5 @@ window.onload = function(){
}else{
switchTab('tree');
}
-};
+}));
+

0 comments on commit fe942d9

Please sign in to comment.
Something went wrong with that request. Please try again.