Commit 3cf7fefa authored by JC Brand's avatar JC Brand

Make the `:last-child` selector more specific

otherwise deeper leaf-nodes get returned
parent 49addedd
......@@ -1827,7 +1827,7 @@
displayJoinNotification (stanza) {
const nick = Strophe.getResourceFromJid(stanza.getAttribute('from'));
const stat = stanza.querySelector('status');
const last_el = this.content.querySelector(':last-child');
const last_el = this.content.querySelector('.message:last-child');
if (_.includes(_.get(last_el, 'classList', []), 'chat-info') &&
_.get(last_el, 'dataset', {}).leave === `"${nick}"`) {
last_el.outerHTML =
......
<div class="chat-info" {{{o.data}}}>{{{o.message}}}</div>
<div class="message chat-info" {{{o.data}}}>{{{o.message}}}</div>
<div class="chat-message {{{o.extra_classes}}}" data-isodate="{{{o.isodate}}}" data-msgid="{{{o.msgid}}}">
<div class="message chat-message {{{o.extra_classes}}}" data-isodate="{{{o.isodate}}}" data-msgid="{{{o.msgid}}}">
<span class="chat-msg-author chat-msg-{{{o.sender}}}">{{{o.time}}} {{{o.username}}}:&nbsp;</span>
<span class="chat-msg-content"><!-- message gets added here via renderMessage --></span>
</div>
......@@ -169,7 +169,7 @@
return _.includes(el.classList, className);
};
u.slideOut = function (el, duration=250) {
u.slideOut = function (el, duration=200) {
/* Shows/expands an element by sliding it out of itself
*
* Parameters:
......@@ -233,7 +233,7 @@
});
};
u.slideIn = function (el, duration=250) {
u.slideIn = function (el, duration=200) {
/* Hides/collapses an element by sliding it into itself. */
return new Promise((resolve, reject) => {
if (_.isNil(el)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment