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

[NEW] Add reaction to the last message when get the shortcut +: #7569

Merged
merged 11 commits into from
Jul 27, 2017
Prev Previous commit
Next Next commit
🎨 Remove unnecessary code
I haven't notice that we can insert a prefix and/or suffix in the final
string on config, thanks @rodrigok 🚀
  • Loading branch information
danilomiranda committed Jul 25, 2017
commit 7e6f96a01156cdb2cc2dfd661f1276163789ee76
4 changes: 0 additions & 4 deletions packages/rocketchat-ui-message/client/popup/messagePopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ Template.messagePopup.onCreated(function() {
return;
}
const value = template.input.value;
const preColon = value.substr(0, value.indexOf(':'));
const caret = getCursorPosition(template.input);
let firstPartValue = value.substr(0, caret);
const lastPartValue = value.substr(caret);
Expand All @@ -201,9 +200,6 @@ Template.messagePopup.onCreated(function() {
return;
}
firstPartValue = firstPartValue.replace(template.selectorRegex, template.prefix + getValue + template.suffix);
if (preColon) {
firstPartValue = preColon + firstPartValue;
}

template.input.value = firstPartValue + lastPartValue;
return setCursorPosition(template.input, firstPartValue.length);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ Template.messagePopupConfig.helpers({
collection: RocketChat.emoji.list,
template: 'messagePopupEmoji',
trigger: '\\+',
prefix: '',
prefix: '+',
suffix: ' ',
getInput: self.getInput,
getFilter(collection, filter) {
Expand Down