diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2016-09-14 14:20:26 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2016-10-04 13:04:56 +0200 |
commit | 5ca50d9f317cdba788005b2212161c9a59df7d12 (patch) | |
tree | 922e6864fee11e87406317ee4b980856dfa4a088 /apps/comments/js/commentstabview.js | |
parent | c5d24a6b0798ee0af94312eea33e4c63631ef9c0 (diff) | |
download | nextcloud-server-5ca50d9f317cdba788005b2212161c9a59df7d12.tar.gz nextcloud-server-5ca50d9f317cdba788005b2212161c9a59df7d12.zip |
Add autosize to comments input
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/comments/js/commentstabview.js')
-rw-r--r-- | apps/comments/js/commentstabview.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/comments/js/commentstabview.js b/apps/comments/js/commentstabview.js index 82244d61e9a..fe3695569bf 100644 --- a/apps/comments/js/commentstabview.js +++ b/apps/comments/js/commentstabview.js @@ -32,7 +32,7 @@ '{{/if}}' + ' </div>' + ' <form class="newCommentForm">' + - ' <input type="text" class="message" placeholder="{{newMessagePlaceholder}}" value="{{message}}" />' + + ' <textarea rows="1" class="message" placeholder="{{newMessagePlaceholder}}">{{message}}</textarea>' + ' <input class="submit icon-confirm" type="submit" value="" />' + '{{#if isEditMode}}' + ' <input class="cancel pull-right" type="button" value="{{cancelText}}" />' + @@ -174,6 +174,8 @@ } this.delegateEvents(); this.$el.find('.message').on('keydown input change', this._onTypeComment); + + autosize(this.$el.find('.newCommentRow textarea')) }, _formatItem: function(commentModel) { @@ -281,6 +283,9 @@ $formRow.find('.avatar').replaceWith($comment.find('.avatar').clone()); $formRow.find('.has-tooltip').tooltip(); + // Enable autosize + autosize($formRow.find('textarea')); + return false; }, @@ -346,7 +351,6 @@ } }); - return false; }, |