advanced-chat
advanced-chat copied to clipboard
Spaces in people-names breaks "is-typing" functionality.
Just FYI, the selector breaks when a person has a name like "Some Bro", anything with a space. I didn't clone your repo or anything so I'm just posting the issue + fix here. In clien.js
socket.on("isTyping", function(data) { if (data.isTyping) { if ($("#"+data.person.split(' ').join('-')+"").length === 0) { $("#updates").append("<li id='"+ data.person.split(' ').join('-') +"'> " + data.person + " is typing."); ......MY CUSTOM CALLBACK, OMITTED } } else { $("#"+data.person.split(' ').join('-')+"").remove(); } });
As you can see it's a simple matter of splitting where any spaces are and joining by a non space char. Cool app, much thanks for sharing it. :)
Thanks Jesse - you can of course do a pull request and submit this fix :)
I’m swamped with all sorts of other work so I may struggle to update this
Thank you,
- Tamas
http://me.tamas.io/
On 8 Nov 2014, at 11:01, Jesse Nicholson [email protected] wrote:
Just FYI, the selector breaks when a person has a name like "Some Bro", anything with a space. I didn't clone your repo or anything so I'm just posting the issue + fix here. In clien.js
socket.on("isTyping", function(data) { if (data.isTyping) { if ($("#"+data.person.split(' ').join('-')+"").length === 0) { $("#updates").append("
" + data.person + " is typing."); ......MY CUSTOM CALLBACK, OMITTED } } else { $("#"+data.person.split(' ').join('-')+"").remove(); } }); As you can see it's a simple matter of splitting where any spaces are and joining by a non space char. Cool app, much thanks for sharing it. :)
— Reply to this email directly or view it on GitHub https://github.com/tamaspiros/advanced-chat/issues/11.