Skip to content
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

[FIX] Fix messagebox growth #7629

Merged
merged 1 commit into from
Aug 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 6 additions & 17 deletions packages/rocketchat-theme/client/imports/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -1568,11 +1568,8 @@ label.required::after {
flex-flow: row nowrap;
padding: 0 10px 0 20px;
border-width: 0 0 1px;
z-index: 100;
top: 0;
left: 0;
width: 100%;
height: calc(var(--header-min-height) + 1px);
flex-shrink: 0;

&.visible h2 {
overflow: visible;
Expand Down Expand Up @@ -2130,15 +2127,14 @@ label.required::after {

.messages-container {
position: relative;
height: 100%;
width: 100%;
top: 0;
left: 0;
z-index: 1;
flex: 1;
display: flex;
flex-direction: column;

&-wrapper {
height: 100%;
display: flex;
flex-grow: 1;
}

&-main {
Expand Down Expand Up @@ -2175,12 +2171,7 @@ label.required::after {
& .footer {
padding: 8px 20px 0;
border-width: 1px 0 0;
z-index: 100;
bottom: 0;
left: 0;
width: 100%;
min-height: var(--footer-min-height);
height: 130px;
flex-shrink: 0;
}

& .message-form {
Expand Down Expand Up @@ -2534,7 +2525,6 @@ label.required::after {
.messages-box {
position: relative;
overflow: hidden;
width: 100%;
flex-grow: 1;

& .message-cog-container .message-action.jump-to-search-message {
Expand Down Expand Up @@ -3273,7 +3263,6 @@ body:not(.is-cordova) {

&.opened .flex-tab {
display: block;
height: calc(100% - 61px); /* --header-height */
}
}

Expand Down
14 changes: 1 addition & 13 deletions packages/rocketchat-ui/client/lib/chatMessages.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ this.ChatMessages = class ChatMessages {
this.bindEvents();
}

resize() {
let dif = (RocketChat.Layout.isEmbedded() ? 0 : 60) + $('.messages-container').find('footer').outerHeight();
dif += $('.announcement').length > 0 ? 40 : 0;
return $('.messages-box').css({
height: `calc(100% - ${ dif }px)`});
}

getEditingIndex(element) {
const msgs = this.wrapper.get(0).querySelectorAll('.own:not(.system)');
let index = 0;
Expand Down Expand Up @@ -361,11 +354,7 @@ this.ChatMessages = class ChatMessages {

bindEvents() {
if (this.wrapper && this.wrapper.length) {
return $('.input-message').autogrow({
postGrowCallback: () => {
return this.resize();
}
});
$('.input-message').autogrow();
}
}

Expand Down Expand Up @@ -416,7 +405,6 @@ this.ChatMessages = class ChatMessages {
const input = event.currentTarget;
// const $input = $(input);
const k = event.which;
this.resize(input);

if (k === 13) {
if (sendOnEnter == null || sendOnEnter === 'normal' || sendOnEnter === 'desktop' && Meteor.Device.isDesktop()) {
Expand Down
5 changes: 0 additions & 5 deletions packages/rocketchat-ui/client/views/app/room.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,6 @@ Template.room.helpers({
showAnnouncement() {
const roomData = Session.get(`roomData${ this._id }`);
if (!roomData) { return false; }
Meteor.defer(() => {
if (window.chatMessages && window.chatMessages[roomData._id]) {
return window.chatMessages[roomData._id].resize();
}
});
return (roomData.announcement !== undefined) && (roomData.announcement !== '');
},

Expand Down