diff options
author | cvogeley <christian.vogeley@hotmail.de> | 2014-02-01 14:43:33 -0800 |
---|---|---|
committer | cvogeley <christian.vogeley@hotmail.de> | 2014-02-01 14:43:33 -0800 |
commit | 3b1346c143fef300cbf0bec38333b0b772a01ceb (patch) | |
tree | f05f4c07ad8e8e0f4e53897a6f54e57cc663b57d /view/tpl | |
parent | 94d874c0b2b5e719af3aa676d015307bab514b6a (diff) | |
parent | 30aeb42bed0b4bb6bf90c16674565ee5d7a26945 (diff) | |
download | volse-hubzilla-3b1346c143fef300cbf0bec38333b0b772a01ceb.tar.gz volse-hubzilla-3b1346c143fef300cbf0bec38333b0b772a01ceb.tar.bz2 volse-hubzilla-3b1346c143fef300cbf0bec38333b0b772a01ceb.zip |
Merge pull request #295 from cvogeley/master
Press return to post chat posts- SHIFT-RETURN creates line break
Diffstat (limited to 'view/tpl')
-rw-r--r-- | view/tpl/chat.tpl | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/view/tpl/chat.tpl b/view/tpl/chat.tpl index 0ebe879a1..a0c18f8d6 100644 --- a/view/tpl/chat.tpl +++ b/view/tpl/chat.tpl @@ -89,3 +89,20 @@ function update_chats(chats) { } </script> +<script> +function isMobile() { + try{ document.createEvent("TouchEvent"); return true; } + catch(e){ return false; } +} +$(function(){ + + $('#chatText').keypress(function(e){ + if (e.keyCode == 13 && e.shiftKey||isMobile()) { + } + else if (e.keyCode == 13) { + e.preventDefault(); + $(this).parent('form').trigger('submit'); + } + }); +}); +</script> |