From e70a8ed51aabcc07ae1f44baa6cf60df83f83087 Mon Sep 17 00:00:00 2001 From: Victor Silva Date: Thu, 21 Apr 2016 13:10:40 -0300 Subject: [PATCH] Add willDestroy to service to remove onblur and onfocus handlers --- addon/services/visible.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addon/services/visible.js b/addon/services/visible.js index bbd7016..59d5e87 100644 --- a/addon/services/visible.js +++ b/addon/services/visible.js @@ -48,5 +48,9 @@ export default Ember.Service.extend({ }; window.onfocus = boundCallback; }, + willDestroy: function() { + window.onblur = () => {}; + window.onfocus = () => {}; + } });