diff --git a/client/stylesheets/base.less b/client/stylesheets/base.less index 3f06a8a9fa9fb..3be3ceef53fa6 100644 --- a/client/stylesheets/base.less +++ b/client/stylesheets/base.less @@ -1448,13 +1448,15 @@ a.github-fork { -moz-user-select: text; -ms-user-select: text; user-select: text; + .input-message-editing-container { + .calc(width, ~"100% - 16px"); + } .input-message-editing { - display: block; resize: none; + display: block; padding-top: 9px; padding-bottom: 9px; overflow-y: hidden; - .calc(width, ~"100% - 16px"); } .edit-room-title { color: @secondary-font-color; @@ -1487,11 +1489,14 @@ a.github-fork { width: 100%; min-height: @footer-min-height; } + .message-popup-position { + position: relative; + } .message-popup { position: absolute; background: #FAFAFA; z-index: 101; - bottom: @footer-min-height; + bottom: 0px; left: 0px; right: 0px; overflow: hidden; diff --git a/client/views/app/chatMessageDashboard.coffee b/client/views/app/chatMessageDashboard.coffee index 76d97bfd6af65..367401c462760 100644 --- a/client/views/app/chatMessageDashboard.coffee +++ b/client/views/app/chatMessageDashboard.coffee @@ -48,6 +48,13 @@ Template.chatMessageDashboard.helpers text = text.replace(/#/g, '\\#') return text + getPupupConfig: -> + template = Template.instance() + return { + getInput: -> + return template.find('.input-message-editing') + } + Template.chatMessageDashboard.events 'mousedown .edit-message': -> self = this diff --git a/client/views/app/chatMessageDashboard.html b/client/views/app/chatMessageDashboard.html index 5572cbf922648..3d855d0ec1f9e 100644 --- a/client/views/app/chatMessageDashboard.html +++ b/client/views/app/chatMessageDashboard.html @@ -16,7 +16,10 @@ {{#if isEditing}} - +
+ {{> messagePopupConfig getPupupConfig}} + +
{{else}}
{{#markdown}}{{#emojione}}{{message}}{{/emojione}}{{/markdown}} diff --git a/client/views/app/chatWindowDashboard.coffee b/client/views/app/chatWindowDashboard.coffee index 9b65a4bdfe07b..4bc497d771ca8 100644 --- a/client/views/app/chatWindowDashboard.coffee +++ b/client/views/app/chatWindowDashboard.coffee @@ -259,66 +259,12 @@ Template.chatWindowDashboard.helpers else return t('chatWindowDashboard.See_all') - popupUserConfig: -> + getPupupConfig: -> template = Template.instance() - config = - title: 'People' - collection: Meteor.users - template: 'messagePopupUser' - getInput: -> - return template.find('.input-message') - getFilter: (collection, filter) -> - exp = new RegExp(filter, 'i') - return collection.find({username: {$exists: true}, $or: [{name: exp}, {username: exp}]}, {limit: 10}) - getValue: (_id, collection) -> - return collection.findOne(_id)?.username - - return config - - popupChannelConfig: -> - template = Template.instance() - config = - title: 'Channels' - collection: ChatRoom - trigger: '#' - template: 'messagePopupChannel' - getInput: -> - return template.find('.input-message') - getFilter: (collection, filter) -> - return collection.find({t: 'c', name: new RegExp(filter, 'i')}, {limit: 10}) - getValue: (_id, collection) -> - return collection.findOne(_id)?.name - - return config - - popupEmojiConfig: -> - template = Template.instance() - config = - title: 'Emoji' - collection: emojione.emojioneList - template: 'messagePopupEmoji' - trigger: ':' - prefix: '' + return { getInput: -> return template.find('.input-message') - getFilter: (collection, filter) -> - results = [] - for shortname, data of collection - if shortname.indexOf(filter) > -1 - results.push - _id: shortname - data: data - - if results.length > 10 - break - - if filter.length >= 3 - results.sort (a, b) -> - a.length > b.length - - return results - - return config + } Template.chatWindowDashboard.events diff --git a/client/views/app/chatWindowDashboard.html b/client/views/app/chatWindowDashboard.html index 7dab094cd41f4..63dcc7ee2713e 100644 --- a/client/views/app/chatWindowDashboard.html +++ b/client/views/app/chatWindowDashboard.html @@ -53,11 +53,11 @@

{{_ "chatWindowDashboard.New_messages"}}

- {{> messagePopup popupEmojiConfig}} {{> messagePopup popupChannelConfig}} {{> messagePopup popupUserConfig}}