diff --git a/app/theme/client/imports/components/messages.css b/app/theme/client/imports/components/messages.css index 01ddccf00d3..3dd839921d8 100644 --- a/app/theme/client/imports/components/messages.css +++ b/app/theme/client/imports/components/messages.css @@ -49,8 +49,37 @@ display: none; } - &--ignored { - & .body { + &&--ignored { + min-height: 25px; + padding: 2px 50px 2px 70px; + + font-size: 12px; + + & > .thumb { + top: 3px; + + width: 20px; + height: 20px; + margin-left: 16px; + + & .avatar { + width: 100%; + height: 100%; + } + } + + & .user { + font-size: 0.75rem; + font-weight: initial; + } + + & .message-body-wrapper .body, + & .message-oembed, + & .attachment, + & .message-discussion, + & .reactions, + & .edited, + & .role-tag { display: none; } diff --git a/app/threads/client/flextab/thread.html b/app/threads/client/flextab/thread.html index e4a438a9b5f..155f6274387 100644 --- a/app/threads/client/flextab/thread.html +++ b/app/threads/client/flextab/thread.html @@ -21,7 +21,7 @@ {{> loading}} {{else}} - {{> message groupable=false hideRoles=true msg=mainMessage room=room subscription=subscription settings=settings customClass="thread-message" templatePrefix='thread-' customClass="thread-main" u=u}} + {{> message groupable=false hideRoles=true msg=mainMessage room=room subscription=subscription settings=settings customClass="thread-message" templatePrefix='thread-' customClass="thread-main" u=u ignored=false}} {{#each msg in messages}} {{> message hideRoles=true msg=msg room=room subscription=subscription settings=settings templatePrefix='thread-' u=u context="threads"}} {{/each}} diff --git a/app/threads/client/flextab/thread.js b/app/threads/client/flextab/thread.js index 015e2eea89c..5be9576c7ee 100644 --- a/app/threads/client/flextab/thread.js +++ b/app/threads/client/flextab/thread.js @@ -32,6 +32,10 @@ Template.thread.events({ const { atBottom } = this; atBottom && this.sendToBottom(); }, + 'click .toggle-hidden'(e) { + const id = e.currentTarget.dataset.message; + document.querySelector(`#thread-${ id }`).classList.toggle('message--ignored'); + }, }); Template.thread.helpers({ diff --git a/app/threads/client/flextab/threads.html b/app/threads/client/flextab/threads.html index db2804b7816..f7fdbbc7aaa 100644 --- a/app/threads/client/flextab/threads.html +++ b/app/threads/client/flextab/threads.html @@ -20,6 +20,7 @@ showDateSeparator=false context="threads" timeAgo=true + ignored=false }} {{/each}} diff --git a/app/ui-message/client/message.js b/app/ui-message/client/message.js index 1624574b180..23c07058a82 100644 --- a/app/ui-message/client/message.js +++ b/app/ui-message/client/message.js @@ -118,12 +118,14 @@ Template.message.helpers({ return !msg.private && !msg.t && msg.u._id !== u._id && room && room.broadcast; }, isIgnored() { - const { msg } = this; - return msg.ignored; + const { ignored, msg } = this; + const isIgnored = typeof ignored !== 'undefined' ? ignored : msg.ignored; + return isIgnored; }, ignoredClass() { - const { msg } = this; - return msg.ignored ? 'message--ignored' : ''; + const { ignored, msg } = this; + const isIgnored = typeof ignored !== 'undefined' ? ignored : msg.ignored; + return isIgnored ? 'message--ignored' : ''; }, isDecrypting() { const { msg } = this;