page load perfomance improvements...
remove the lists.js file from the <head>, which slows down page load a lot (over 300K), and instead load it dynamically on page load. also remove navtree_data.js from the <head>, which also slows the load and is only used in the reference when in tree view. This file is now loaded during the initialization of the nav tree.
This commit is contained in:
@@ -31,6 +31,15 @@ if ((agent.indexOf("Mobile") != -1) ||
|
||||
addLoadEvent(mobileSetup);
|
||||
}
|
||||
|
||||
/* loads the lists.js file to the page.
|
||||
Loading this in the head was slowing page load time */
|
||||
addLoadEvent( function() {
|
||||
var lists = document.createElement("script");
|
||||
lists.setAttribute("type","text/javascript");
|
||||
lists.setAttribute("src", toRoot+"reference/lists.js");
|
||||
$("head").append($(lists));
|
||||
} );
|
||||
|
||||
window.onresize = resizeAll;
|
||||
|
||||
function mobileSetup() {
|
||||
@@ -282,7 +291,7 @@ function swapNav() {
|
||||
nav_pref = NAV_PREF_PANELS;
|
||||
} else {
|
||||
nav_pref = NAV_PREF_TREE;
|
||||
init_navtree("nav-tree", toRoot, NAVTREE_DATA);
|
||||
init_default_navtree(toRoot);
|
||||
}
|
||||
var date = new Date();
|
||||
date.setTime(date.getTime()+(10*365*24*60*60*1000)); // keep this for 10 years
|
||||
|
Reference in New Issue
Block a user