Skip to content

Commit

Permalink
[FIX] Channel settings form to textarea for Topic and Description (#1…
Browse files Browse the repository at this point in the history
…3328)

* fix: make room description and topic text area

* cleanup: remove comments

* fix review
  • Loading branch information
supra08 authored and ggazzo committed May 16, 2019
1 parent 9bc520d commit cb4680d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
html.rtl .flex-tab {
.rtl .flex-tab {
direction: rtl;

& .channel-settings {
Expand Down
4 changes: 2 additions & 2 deletions app/channel-settings/client/views/channelSettings.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<label class="rc-input__label">
<div class="rc-input__title">{{_ label}}{{equal default value '*'}}</div>
<div class="rc-input__wrapper">
<input type="text" name="topic" value="{{value}}" class="rc-input__element js-input" disabled="{{./disabled}}"/>
<textarea name="topic" value="{{value}}" class="rc-input__element js-input" disabled="{{./disabled}}" id="" cols="30" rows="2"></textarea>
</div>
</label>
</div>
Expand All @@ -54,7 +54,7 @@
<label class="rc-input__label">
<div class="rc-input__title">{{_ label}}{{equal default value '*'}}</div>
<div class="rc-input__wrapper">
<input type="text" name="description" value="{{value}}" class="rc-input__element js-input" disabled="{{./disabled}}"/>
<textarea name="description" value="{{value}}" class="rc-input__element js-input" disabled="{{./disabled}}" id="" cols="30" rows="2"></textarea>
</div>
</label>
</div>
Expand Down
10 changes: 3 additions & 7 deletions app/ui/client/components/header/headerRoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,15 @@ Template.headerRoom.helpers({
const roomData = Session.get(`roomData${ this._id }`);
if (!roomData || !roomData.topic) { return ''; }

let roomTopic = Markdown.parse(roomData.topic);
let roomTopic = Markdown.parse(roomData.topic.replace(/\n/mg, ' '));

// &#39; to apostrophe (') for emojis such as :')
roomTopic = roomTopic.replace(/&#39;/g, '\'');

Object.keys(emoji.packages).forEach((emojiPackage) => {
roomTopic = emoji.packages[emojiPackage].render(roomTopic);
});
roomTopic = Object.keys(emoji.packages).reduce((topic, emojiPackage) => emoji.packages[emojiPackage].render(topic), roomTopic);

// apostrophe (') back to &#39;
roomTopic = roomTopic.replace(/\'/g, '&#39;');

return roomTopic;
return roomTopic.replace(/\'/g, '&#39;');
},

roomIcon() {
Expand Down

0 comments on commit cb4680d

Please sign in to comment.