Unbind frontend listeners when window closes

pull/749/head
lilia 10 years ago
parent 69d5a6a33c
commit 651b6341fa

@ -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…
Cancel
Save