Highlight messages when jump-to is used

Allow selecting user info text
pull/1852/head
Marcelo Schmidt 10 years ago
parent 47b23b324d
commit fd7599c240
  1. 16
      packages/rocketchat-theme/assets/stylesheets/base.less
  2. 21
      packages/rocketchat-ui/lib/RoomHistoryManager.coffee

@ -2516,6 +2516,13 @@ a.github-fork {
line-height: 20px;
min-height: 40px;
&.highlight {
-webkit-animation: highlight 3s;
-moz-animation: highlight 3s;
-o-animation: highlight 3s;
animation: highlight 3s;
}
.body, .user.user-card-message, .time {
-webkit-user-select: text;
-moz-user-select: text;
@ -3073,7 +3080,12 @@ a.github-fork {
margin-left: 120px;
white-space: normal;
.calc(width, ~'100% - 120px');
h3 {
-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
font-size: 24px;
margin-bottom: 8px;
line-height: 27px;
@ -3109,6 +3121,10 @@ a.github-fork {
}
}
p {
-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
line-height: 18px;
font-size: 12px;
font-weight: 300;

@ -107,6 +107,8 @@
unless message?.rid
return
instance = Blaze.getView($('.messages-box .wrapper')[0]).templateInstance()
if ChatMessage.findOne message._id
wrapper = $('.messages-box .wrapper')
msgElement = $("##{message._id}", wrapper)
@ -114,6 +116,15 @@
wrapper.animate({
scrollTop: pos
}, 500)
msgElement.addClass('highlight')
setTimeout ->
messages = wrapper[0]
instance.atBottom = messages.scrollTop >= messages.scrollHeight - messages.clientHeight;
setTimeout ->
msgElement.removeClass('highlight')
, 3000
else
room = getRoom message.rid
room.isLoading.set true
@ -134,7 +145,6 @@
if item.t isnt 'command'
ChatMessage.upsert {_id: item._id}, item
instance = Blaze.getView($('.messages-box .wrapper')[0]).templateInstance()
Meteor.defer ->
readMessage.refreshUnreadMark(message.rid, true)
RoomManager.updateMentionsMarksOfRoom typeName
@ -144,11 +154,18 @@
wrapper.animate({
scrollTop: pos
}, 500)
msgElement.addClass('highlight')
setTimeout ->
room.isLoading.set false
instance.atBottom = !result.moreAfter
messages = wrapper[0]
instance.atBottom = !result.moreAfter && messages.scrollTop >= messages.scrollHeight - messages.clientHeight;
, 500
setTimeout ->
msgElement.removeClass('highlight')
, 3000
room.loaded += result.messages.length
room.hasMore.set result.moreBefore
room.hasMoreNext.set result.moreAfter

Loading…
Cancel
Save