Skip to content

Commit

Permalink
[FIX] Message popup responsiveness in slash commands (#11313)
Browse files Browse the repository at this point in the history
* Fix icons in channels message popup

* Fix descriptions in slash commands message popup

* Add scrolling in message popup
  • Loading branch information
tassoevan authored and ggazzo committed Jul 5, 2018
1 parent f0f7ef2 commit 3ebe15d
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 9 deletions.
31 changes: 27 additions & 4 deletions packages/rocketchat-theme/client/imports/general/base_old.css
Original file line number Diff line number Diff line change
Expand Up @@ -2614,6 +2614,33 @@

.rc-old .message-popup-position {
position: relative;

.message-popup {
display: flex;
flex-direction: column;
align-items: stretch;
max-height: 20rem;

.message-popup-items {
overflow-y: auto;

.popup-slash-command {
display: flex;
flex-direction: row;
flex-wrap: wrap;

&-format {
flex-grow: 1;
}

&-description {
flex-grow: 2;
font-style: italic;
text-align: right;
}
}
}
}
}

.rc-old .message-popup-items.preview-items {
Expand Down Expand Up @@ -2773,10 +2800,6 @@
border-radius: 10px;
}

.rc-old .popup-slash-command-description {
float: right;
}

.messages-box {
position: relative;

Expand Down
2 changes: 2 additions & 0 deletions packages/rocketchat-ui-message/client/popup/messagePopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ Template.messagePopup.onCreated(function() {
if (previous != null) {
current.className = current.className.replace(/\sselected/, '').replace('sidebar-item__popup-active', '');
previous.className += ' selected sidebar-item__popup-active';
previous.scrollIntoView(false);
return template.value.set(previous.getAttribute('data-id'));
}
};
Expand All @@ -90,6 +91,7 @@ Template.messagePopup.onCreated(function() {
if (next && next.classList.contains('popup-item')) {
current.className = current.className.replace(/\sselected/, '').replace('sidebar-item__popup-active', '');
next.className += ' selected sidebar-item__popup-active';
next.scrollIntoView(false);
return template.value.set(next.getAttribute('data-id'));
}
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<template name="messagePopupChannel">
<i class="{{icon}}"></i>
{{> icon icon=channelIcon }}
{{name}}
</template>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Template.messagePopupChannel.helpers({
icon() {
channelIcon() {
return RocketChat.roomTypes.getIcon(this.t);
}
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<template name="messagePopupSlashCommand">
<strong>/{{_id}}</strong>{{#if params}} {{params}}{{/if}}
<div class="popup-slash-command-description"><i>{{description}}</i></div>
</template>
<div class="popup-slash-command">
<div class="popup-slash-command-format"><strong>/{{_id}}</strong>{{#if params}} {{params}}{{/if}}</div>
<div class="popup-slash-command-description">{{description}}</div>
</div>
</template>

0 comments on commit 3ebe15d

Please sign in to comment.