From 5717e75bf02f8a3f17cc40dd7dee11690fa055e9 Mon Sep 17 00:00:00 2001 From: Tor Hveem Date: Sun, 29 Mar 2015 15:56:33 +0200 Subject: [PATCH] Use events to fix mobile keyboard to not cover the input element --- js/glowingbear.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/js/glowingbear.js b/js/glowingbear.js index 9660570..b5a7309 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -753,4 +753,13 @@ weechat.config(['$routeProvider', } ]); +/* To make chrome mobile display the input element we hook events here */ +var input = document.getElementById('sendMessage'); +input.addEventListener('focus', function() { + window.location.hash = 'sendMessage'; +}); +input.addEventListener('blur', function() { + window.location.hash = ''; +}); + })();