Fix: Unread line

pull/9149/head
Rodrigo Nascimento 8 years ago
parent 6b442864ca
commit 3fe690bcf4
No known key found for this signature in database
GPG Key ID: CFCE33B7B01AC335
  1. 13
      packages/rocketchat-theme/client/imports/general/base.css
  2. 12
      packages/rocketchat-theme/client/imports/general/base_old.css
  3. 11
      packages/rocketchat-ui/client/views/app/modal.js
  4. 36
      packages/rocketchat-ui/client/views/app/room.js
  5. 2
      tests/chimp-config.js

@ -121,7 +121,7 @@ button {
&::before {
position: absolute;
z-index: 1;
top: -10px;
top: 0;
left: 0;
width: 100%;
@ -137,14 +137,15 @@ button {
&::after {
position: absolute;
z-index: 2;
top: -20px;
top: -6px;
right: 0;
padding: 0 1rem;
padding: 0 5px;
padding-bottom: 2px;
content: attr(data-unread-text);
text-align: right;
text-transform: uppercase;
text-transform: lowercase;
color: var(--rc-color-error);
background: #ffffff;
@ -152,6 +153,8 @@ button {
font-size: 10px;
pointer-events: none;
line-height: 10px;
border-radius: 2px;
}
}
@ -166,7 +169,7 @@ button {
}
&::after {
top: -30px;
top: -26px;
}
}
}

@ -2145,7 +2145,7 @@
.rc-old .container-bars {
position: absolute;
z-index: 1;
z-index: 2;
top: 4px; /* --header-height */
right: 10px;
left: 10px;
@ -2879,7 +2879,7 @@
}
&.new-day {
margin-top: 60px;
margin-top: 40px;
&::before {
position: absolute;
@ -2897,6 +2897,8 @@
font-size: 12px;
font-weight: 600;
pointer-events: none;
}
&::after {
@ -2911,6 +2913,8 @@
content: " ";
border-width: 1px 0 0;
pointer-events: none;
}
}
@ -3096,10 +3100,6 @@
}
&.first-unread {
margin-top: 20px;
}
&.system .body {
font-style: italic;

@ -51,14 +51,15 @@ this.modal = {
errorEl.style.display = 'block';
},
onKeydown(e) {
e.preventDefault();
e.stopPropagation();
if (e.key === 'Enter') {
e.preventDefault();
e.stopPropagation();
modal.confirm(true);
}
} else if (e.key === 'Escape') {
e.preventDefault();
e.stopPropagation();
if (e.key === 'Escape') {
modal.close();
}
}

@ -917,26 +917,36 @@ Template.room.onRendered(function() {
const rtl = $('html').hasClass('rtl');
const updateUnreadCount = _.throttle(function() {
let lastInvisibleMessageOnScreen;
const getElementFromPoint = function(topOffset = 0) {
const messageBoxOffset = messageBox.offset();
let element;
if (rtl) {
lastInvisibleMessageOnScreen = document.elementFromPoint((messageBoxOffset.left + messageBox.width()) - 1, messageBoxOffset.top + 1);
element = document.elementFromPoint((messageBoxOffset.left + messageBox.width()) - 1, messageBoxOffset.top + topOffset + 1);
} else {
lastInvisibleMessageOnScreen = document.elementFromPoint(messageBoxOffset.left + 1, messageBoxOffset.top + 1);
element = document.elementFromPoint(messageBoxOffset.left + 1, messageBoxOffset.top + topOffset + 1);
}
if ((lastInvisibleMessageOnScreen != null ? lastInvisibleMessageOnScreen.id : undefined) != null) {
const lastMessage = ChatMessage.findOne(lastInvisibleMessageOnScreen.id);
if (lastMessage != null) {
const subscription = ChatSubscription.findOne({ rid: template.data._id });
const count = ChatMessage.find({ rid: template.data._id, ts: { $lte: lastMessage.ts, $gt: (subscription != null ? subscription.ls : undefined) } }).count();
template.unreadCount.set(count);
} else {
template.unreadCount.set(0);
}
if (element && element.classList.contains('message')) {
return element;
}
};
const updateUnreadCount = _.throttle(function() {
const lastInvisibleMessageOnScreen = getElementFromPoint(0) || getElementFromPoint(20) || getElementFromPoint(40);
if (lastInvisibleMessageOnScreen == null || lastInvisibleMessageOnScreen.id == null) {
return template.unreadCount.set(0);
}
const lastMessage = ChatMessage.findOne(lastInvisibleMessageOnScreen.id);
if (lastMessage == null) {
return template.unreadCount.set(0);
}
const subscription = ChatSubscription.findOne({ rid: template.data._id }, {reactive: false});
const count = ChatMessage.find({ rid: template.data._id, ts: { $lte: lastMessage.ts, $gt: subscription && subscription.ls } }).count();
template.unreadCount.set(count);
}, 300);
readMessage.onRead(function(rid) {

@ -27,7 +27,7 @@ module.exports = {
// chai: false,
screenshotsOnError: true,
screenshotsPath: '.screenshots',
captureAllStepScreenshots: true,
captureAllStepScreenshots: false,
saveScreenshotsToDisk: true,
// // Note: With a large viewport size and captureAllStepScreenshots enabled,
// // you may run out of memory. Use browser.setViewportSize to make the

Loading…
Cancel
Save