From 5e6145aa466d37e42e60fa05e14d06b0945272d4 Mon Sep 17 00:00:00 2001 From: lilia Date: Fri, 26 Jun 2015 11:53:00 -0700 Subject: [PATCH] Mark conversation read on window focus event Fixes #282 // FREEBIE --- js/views/conversation_view.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/views/conversation_view.js b/js/views/conversation_view.js index a93262ccb..7dcd71c06 100644 --- a/js/views/conversation_view.js +++ b/js/views/conversation_view.js @@ -57,8 +57,12 @@ var onResize = this.forceUpdateMessageFieldSize.bind(this); this.appWindow.contentWindow.addEventListener('resize', onResize); + var onfocus = this.markRead.bind(this); + this.appWindow.contentWindow.addEventListener('focus', onfocus); + this.appWindow.onClosed.addListener(function () { this.appWindow.contentWindow.removeEventListener('resize', onResize); + this.appWindow.contentWindow.removeEventListener('focus', onfocus); window.autosize.destroy(this.$messageField); this.remove(); }.bind(this));