Skip to content
Snippets Groups Projects
  • Daniel Calviño Sánchez's avatar
    0db3a413
    Fix mentioned user not clickable after posting or editing a comment · 0db3a413
    Daniel Calviño Sánchez authored
    
    The contactsMenu plugin was called on avatar elements from
    _postRenderItem, which is called when a new comment is added to the
    collection. Due to this contactsMenu was not called when messages were
    edited; when a new comment is posted _postRenderItem is called, but at
    that time the "mentions" attribute is not filled yet, so "@username" is
    not replaced by avatars in the message and thus contactsMenu has no
    avatars to be called on.
    
    Calling contactsMenu was moved to a new method, _postRenderMessage,
    which is called from _postRenderItem and from the success callback when
    fetching the model in _onSubmitSuccess (which replaces "@username" by
    avatars in the message after posting or editing a comment).
    
    Fixes #4555
    
    Signed-off-by: default avatarDaniel Calviño Sánchez <danxuliu@gmail.com>
    0db3a413
    History
    Fix mentioned user not clickable after posting or editing a comment
    Daniel Calviño Sánchez authored
    
    The contactsMenu plugin was called on avatar elements from
    _postRenderItem, which is called when a new comment is added to the
    collection. Due to this contactsMenu was not called when messages were
    edited; when a new comment is posted _postRenderItem is called, but at
    that time the "mentions" attribute is not filled yet, so "@username" is
    not replaced by avatars in the message and thus contactsMenu has no
    avatars to be called on.
    
    Calling contactsMenu was moved to a new method, _postRenderMessage,
    which is called from _postRenderItem and from the success callback when
    fetching the model in _onSubmitSuccess (which replaces "@username" by
    avatars in the message after posting or editing a comment).
    
    Fixes #4555
    
    Signed-off-by: default avatarDaniel Calviño Sánchez <danxuliu@gmail.com>