Use $(window).on() instead of window.addEventListener. Because ¯\_(ツ)_/¯
This commit is contained in:
parent
dc649e2964
commit
0fb85f4656
|
@ -63,7 +63,7 @@
|
||||||
this.qty_pages = Math.ceil( this.model.get( 'rates' ).length / this.per_page );
|
this.qty_pages = Math.ceil( this.model.get( 'rates' ).length / this.per_page );
|
||||||
this.listenTo( this.model, 'change', this.setUnloadConfirmation );
|
this.listenTo( this.model, 'change', this.setUnloadConfirmation );
|
||||||
this.listenTo( this.model, 'saved', this.clearUnloadConfirmation );
|
this.listenTo( this.model, 'saved', this.clearUnloadConfirmation );
|
||||||
window.addEventListener( 'beforeunload', this.unloadConfirmation );
|
$(window).on( 'beforeunload', this.unloadConfirmation );
|
||||||
},
|
},
|
||||||
setUnloadConfirmation : function() {
|
setUnloadConfirmation : function() {
|
||||||
this.needsUnloadConfirm = true;
|
this.needsUnloadConfirm = true;
|
||||||
|
|
Loading…
Reference in New Issue