@@ -76,7 +76,7 @@ proto.createHistoryAppend = function() {
7676 this . scrollPageIndex = 0 ;
7777 // events
7878 this . scrollHistoryHandler = this . onScrollHistory . bind ( this ) ;
79- this . beforeunloadHandler = this . onBeforeunload . bind ( this ) ;
79+ this . unloadHandler = this . onUnload . bind ( this ) ;
8080 this . scroller . addEventListener ( 'scroll' , this . scrollHistoryHandler ) ;
8181 this . on ( 'append' , this . onAppendHistory ) ;
8282 this . bindHistoryAppendEvents ( true ) ;
@@ -85,7 +85,7 @@ proto.createHistoryAppend = function() {
8585proto . bindHistoryAppendEvents = function ( isBind ) {
8686 var addRemove = isBind ? 'addEventListener' : 'removeEventListener' ;
8787 this . scroller [ addRemove ] ( 'scroll' , this . scrollHistoryHandler ) ;
88- window [ addRemove ] ( 'beforeunload ' , this . beforeunloadHandler ) ;
88+ window [ addRemove ] ( 'unload ' , this . unloadHandler ) ;
8989} ;
9090
9191proto . createHistoryPageLoad = function ( ) {
@@ -180,7 +180,7 @@ proto.setHistory = function( title, path ) {
180180
181181// scroll to top to prevent initial scroll-reset after page refresh
182182// http://stackoverflow.com/a/18633915/182183
183- proto . onBeforeunload = function ( ) {
183+ proto . onUnload = function ( ) {
184184 var pageIndex = this . scrollPageIndex ;
185185 if ( pageIndex === 0 ) {
186186 return ;
0 commit comments