-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Fix cursor for avatar and user names in comments #7256
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 cursor for avatar and user names in comments #7256
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7256 +/- ##
============================================
- Coverage 50.85% 50.75% -0.11%
- Complexity 24551 24622 +71
============================================
Files 1585 1585
Lines 93833 94046 +213
Branches 1354 1356 +2
============================================
+ Hits 47719 47731 +12
- Misses 46114 46315 +201
|
|
@danxuliu yeah, we can remove the menu for comments being composed! :) |
When it was on an author row the cursor was shown as a pointer, even if clicking on the author row itself does nothing. On the other hand, avatars used the default cursor, even if clicking on them either shows the contacts menu (in the case of the author row, only when the avatar is for a different user than the current one) or inserts a mention (for avatars shown in the list of suggested mentions), depending on the case. Now, the author row uses the default cursor, and avatars (and their associated user name) use a pointer cursor if clicking on them will trigger an action (either showing the contacts menu or inserting a mention). Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
The contacts menu does not provide too much value for users mentioned in a message being composed, so it is now disabled in this case. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
The contacts menu is not shown for avatars and user names in the author row if they represent the current user. For consistency, and because the contacts menu provides no value when shown for the current user, this commit also disables the contacts menu for mentions to the current user. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
f83a6ca to
ea4414f
Compare
Done! I have also disabled the contacts menu for mentions to the current user in final messages. Also, after disabling the contacts menu for comments being composed and with some changes I made to the original CSS selectors this pull request no longer depends on what is decided in #7254; either way the contacts menu and the cursor will work as expected :-) (or at least I think so :-P ) With all that this pull request is now ready to be reviewed! |
apps/comments/js/commentstabview.js
Outdated
| + ' data-user-display-name="' | ||
| + _.escape(displayName) + '"></div>'; | ||
|
|
||
| var isCurrentUser = (uid === oc_current_user); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oc_current_user is deprecated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me replace that with OC.getCurrentUser().uid
nickvergessen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works 👍
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
LukasReschke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blizzz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested and works
|
(Yes, I am late to the party, but anyway) Oops, I did not know that @LukasReschke Your fix was perfect, thanks :-) |
Although #7256 was merged cleanly some of the changes really conflicted with those introduced by the last commit of #7251, and this broke the appearance of the author row of comments. This commit fixes those silent conflicts and restores the appearance of the author row. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
|
|
||
| $.merge(avatar, strong).contactsMenu(avatar.data('user'), 0, appendTo); | ||
| var username = $(this).data('username'); | ||
| if (username !== oc_current_user) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:( @danxuliu please adjust here too
When it was on an author row the cursor was shown as a pointer, even if clicking on the author row itself does nothing. Also avatars used the default cursor, even if clicking on them shows the contacts menu (if the avatar is for a different user than the current one). Now the cursor is shown as a pointer on avatar and user names of users different than the current one.
There are still some changes pending based on what is decided in #7254 (right now the cursor used for mentions in messages being composed is the default one; changing it to a pointer would require removing
.commentfrom#commentsTabView .comments .message...and also adding thecurrentUserclass to the appropriate mentions through JavaScript).@jancborchardt Besides that maybe the contacts menu should be completely disabled for mentions in messages being composed, as it does not provide too much value there (and, moreover, right now it does not appear in the proper position).