From 00dd1e180a9bc693382e8693695c9f158308c657 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 7 Jul 2015 13:30:38 +0100 Subject: [PATCH] focus message composer when window gets focus --- src/controllers/pages/MatrixChat.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/controllers/pages/MatrixChat.js b/src/controllers/pages/MatrixChat.js index 04735c0b25..600d97e9d9 100644 --- a/src/controllers/pages/MatrixChat.js +++ b/src/controllers/pages/MatrixChat.js @@ -42,6 +42,7 @@ module.exports = { } this.focusComposer = false; document.addEventListener("keydown", this.onKeyDown); + window.addEventListener("focus", this.onFocus); }, componentWillUnmount: function() { @@ -127,6 +128,10 @@ module.exports = { break; } } + }, + + onFocus: function(ev) { + dis.dispatch({action: 'focus_composer'}); } };