non-breaking space after mentions

This commit is contained in:
Hannes Mannerheim 2015-09-19 22:36:15 +02:00
parent 71f4e82ac8
commit d35368039c

View File

@ -2603,7 +2603,7 @@ function useSelectedMention(queetBox){
// replace the halfwritten username with the one we want
deleteBetweenCharacterIndices(queetBox[0], window.lastMention.mentionPos+1, window.lastMention.cursorPos);
var range = createRangeFromCharacterIndices(queetBox[0], window.lastMention.mentionPos+1, window.lastMention.mentionPos+1);
range.insertNode(document.createTextNode(username + ' '));
range.insertNode(document.createTextNode(username + '\u00a0')); // non-breaking-space, to prevent collapse
// put caret after
setSelectionRange(queetBox[0], window.lastMention.mentionPos+username.length+2, window.lastMention.mentionPos+username.length+2);