-
Notifications
You must be signed in to change notification settings - Fork 703
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
Date separator fixes #765
Date separator fixes #765
Conversation
@@ -32,6 +32,7 @@ module.exports = function(irc, network) { | |||
var msg = new Msg({ | |||
self: data.nick === irc.user.nick, | |||
type: Msg.Type.TOGGLE, | |||
time: data.time || new Date().getTime(), |
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.
Msg handles the fallback
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.
ah, will remove that part then
abce6de
to
aa8e0ae
Compare
if (children.eq(0).attr("class") === "date-marker") { // Check top most child | ||
children.eq(0).remove(); | ||
} else if (children.eq(0).attr("class") === "unread-marker" && children.eq(1).attr("class") === "date-marker") { | ||
// Otherwise the date-marker would get 'stuck' because of the new-massages marker |
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.
slight nit-pick: new-massages
-> new-message
Am just going to mention this here: once the client can access npm packages, we can use moments .calender() to create fuzzy time stamps (i.e. "Yesterday") |
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.
Looks good to me.
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.
Actually, 1 small thing.
if (firstChild.attr("class") === "date-marker") { | ||
firstChild.remove(); | ||
var children = $(chan).children(); | ||
if (children.eq(0).attr("class") === "date-marker") { // Check top most child |
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.
Ah wait, can you use jquery's hasClass instead? Because this will only give oyu 1 of the classes, which means that it could create bugs in the future if the date marker ends up having more than 1 class on it.
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.
ah, good idea, will change
var children = $(chan).children(); | ||
if (children.eq(0).attr("class") === "date-marker") { // Check top most child | ||
children.eq(0).remove(); | ||
} else if (children.eq(0).attr("class") === "unread-marker" && children.eq(1).attr("class") === "date-marker") { |
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.
Same here
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.
👍
Err. @astorije didn't this need to be squashed? I am away for a bit so I can't do it, but pretty sure there is an option for you guys to do so. Referring to the last two commits |
Argh, I suck, I meant for it then forgot. Too late now, sorry git history! |
Date separator fixes
Fixes #763 and #760; I decided to do this in one pr since both are so small fixes.
For #763 an extra check was added for the new-messages marker and skips it
For #760 I added the reported time, if that was not available, the current time