Unbind frontend listeners when window closes
This commit is contained in:
parent
69d5a6a33c
commit
651b6341fa
1 changed files with 3 additions and 0 deletions
|
@ -28,6 +28,9 @@
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
this.listenTo(this.model, 'change', this.render); // auto update
|
this.listenTo(this.model, 'change', this.render); // auto update
|
||||||
this.listenTo(this.model, 'destroy', this.remove); // auto update
|
this.listenTo(this.model, 'destroy', this.remove); // auto update
|
||||||
|
window.addEventListener('beforeunload', function () {
|
||||||
|
this.stopListening();
|
||||||
|
}.bind(this));
|
||||||
},
|
},
|
||||||
|
|
||||||
select: function(e) {
|
select: function(e) {
|
||||||
|
|
Loading…
Reference in a new issue