                 return originalText.substr(0, originalText.lastIndexOf(':')) + newEmoji;
             e.preventDefault();
             document.getElementById('message-input').value = newText(document.getElementById('message-input').value.trim())
-
-
 ).bind(this))
 
 clearsImagePreview = ->

                unicodeMap = require '../emojishortcode';
                emojiSuggListIndex = -1;
                if e.keyCode == 32
                    # element = document.getElementById "message-input"
                    # Converts emojicodes (e.g. :smile:, :-) ) to unicode
                    if models.viewstate.convertEmoji
                        # get cursor position

        lastConv = models.viewstate.selectedConv
        laterMaybeFocus()

#suggestEmoji : added enter handle and tab handle to navigate and select emoji when suggested
window.addEventListener('keydown', ((e) ->
    if models.viewstate.suggestEmoji
        if e.keyCode == 9 && document.querySelectorAll('.emoji-sugg-container')[0]
