Browse Source

fix chat editor control in Firefox

Maxim Sokhatsky 11 years ago
parent
commit
82bcac874d
1 changed files with 3 additions and 2 deletions
  1. 3 2
      apps/web/priv/static/app/js/chat.js

+ 3 - 2
apps/web/priv/static/app/js/chat.js

@@ -285,8 +285,9 @@ function chatEditor(evt) {
     var chatContainer = evt.target.getAttribute("xmlns:data");
     if (evt.keyCode == 13 && evt.altKey == false) {
         var e = evt.target;
-        if (e.innerText.trim() != ""){
-            var text = e.innerText.trim().encodeHTML();
+        var text = e.textContent == null?"":e.textContent.trim();
+        if (text != ""){
+            text = text.encodeHTML();
             chatMessage(chatContainer,"100",document.user,text);
                 ws.send(enc(tuple(atom('client'),
                     tuple(atom('message'),