Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions ajaxify-html5.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Ajaxify
// v1.0.1 - 30 September, 2012
// v1.0.2, October 2015
// https://github.com/browserstate/ajaxify
(function(window,undefined){

Expand Down Expand Up @@ -167,12 +167,20 @@
});

// Complete the change
if ( $body.ScrollTo||false ) { $body.ScrollTo(scrollOptions); } /* http://balupton.com/projects/jquery-scrollto */
if ( $body.ScrollTo ) {
$body.ScrollTo(scrollOptions);
} /* http://balupton.com/projects/jquery-scrollto */
else{
// fallback if scrollTo plugin is not loaded:
$body.scrollTop( 0 );
}
$body.removeClass('loading');
$window.trigger(completedEventName);

// Inform Google Analytics of the change
if ( typeof window._gaq !== 'undefined' ) {
if ( typeof window.ga !== 'undefined' ){ // the new analytics API
window.ga( 'send', 'pageview', relativeUrl );
}else if ( typeof window._gaq !== 'undefined' ) { // the old API
window._gaq.push(['_trackPageview', relativeUrl]);
}

Expand All @@ -192,4 +200,4 @@

}); // end onDomLoad

})(window); // end closure
})(window); // end closure