account for child page events

This commit is contained in:
John Bender 2011-11-07 11:06:10 -08:00
parent 7a84306cc2
commit b3fdbcbb78

View file

@ -1,14 +1,23 @@
(function(Perf) {
var $listPage = $( "#list-page" );
var $listPage = $( "#list-page" ), firstCounter = 0;
Perf.setCurrentRev();
Perf.pageLoadStart = Date.now();
$listPage.live( "pagebeforecreate", function() {
Perf.pageCreateStart = Date.now();
if( firstCounter == 0 ) {
Perf.pageCreateStart = Date.now();
firstCounter++;
}
});
$listPage.live( "pageinit", function() {
$listPage.live( "pageinit", function( event ) {
// if a child page init is fired ignore it, we only
// want the top level page init event
if( event.target !== $("#list-page")[0] ){
return;
}
Perf.pageLoadEnd = Date.now();
// report the time taken for a full app boot