- this.messenger.bind( 'activated', function( location ) {
- if ( location )
- window.location = location;
+ // Prompt AYS dialog when navigating away
+ $( window ).on( 'beforeunload', this.beforeunload );
+
+ this.messenger.bind( 'saved', function () {
+ Loader.saved( true );
+ } );
+ this.messenger.bind( 'change', function () {
+ Loader.saved( false );
+ } );
+
+ this.messenger.bind( 'title', function( newTitle ){
+ window.document.title = newTitle;