From 3cf7fefaa8da4163209339b119ef77a750e461dd Mon Sep 17 00:00:00 2001 From: JC Brand Date: Fri, 22 Dec 2017 20:49:10 +0000 Subject: [PATCH] Make the `:last-child` selector more specific otherwise deeper leaf-nodes get returned --- src/converse-muc.js | 2 +- src/templates/info.html | 2 +- src/templates/message.html | 2 +- src/utils.js | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/converse-muc.js b/src/converse-muc.js index 844fc19ae..07134996b 100755 --- a/src/converse-muc.js +++ b/src/converse-muc.js @@ -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 = diff --git a/src/templates/info.html b/src/templates/info.html index 42f9cfd07..f074e198c 100644 --- a/src/templates/info.html +++ b/src/templates/info.html @@ -1 +1 @@ -
{{{o.message}}}
+
{{{o.message}}}
diff --git a/src/templates/message.html b/src/templates/message.html index b203381b1..15cfe1474 100644 --- a/src/templates/message.html +++ b/src/templates/message.html @@ -1,4 +1,4 @@ -
+
{{{o.time}}} {{{o.username}}}: 
diff --git a/src/utils.js b/src/utils.js index 16f4677e9..2a97c180d 100755 --- a/src/utils.js +++ b/src/utils.js @@ -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)) {