Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mentioned user not clickable after posting or editing a comment #4746

Conversation

danxuliu
Copy link
Member

@danxuliu danxuliu commented May 8, 2017

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: Daniel Calviño Sánchez <danxuliu@gmail.com>
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: Daniel Calviño Sánchez <danxuliu@gmail.com>
@mention-bot
Copy link

@danxuliu, thanks for your PR! By analyzing the history of the files in this pull request, we identified @blizzz, @MorrisJobke and @jancborchardt to be potential reviewers.

Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works 👍 Code makes sense

Copy link
Member

@nickvergessen nickvergessen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works

@nickvergessen nickvergessen added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels May 9, 2017
@rullzer rullzer merged commit 04a5c34 into master May 9, 2017
@rullzer rullzer deleted the fix-mentioned-user-not-clickable-after-posting-or-editing-a-comment branch May 9, 2017 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants