From 5ca50d9f317cdba788005b2212161c9a59df7d12 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Wed, 14 Sep 2016 14:20:26 +0200 Subject: [PATCH] Add autosize to comments input Signed-off-by: Roeland Jago Douma --- apps/comments/css/comments.css | 6 +++++- apps/comments/js/commentstabview.js | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/apps/comments/css/comments.css b/apps/comments/css/comments.css index 7f64f1cf7db59..d4b72d21478a5 100644 --- a/apps/comments/css/comments.css +++ b/apps/comments/css/comments.css @@ -25,7 +25,7 @@ #commentsTabView .newCommentForm .submit { position: absolute; - top: 1px; + bottom: 1px; right: 8px; width: 30px; margin: 0; @@ -47,6 +47,10 @@ margin-right: 6px; } +#commentsTabView .newCommentForm textarea { + resize: none; +} + #commentsTabView .comment { position: relative; z-index: 1; diff --git a/apps/comments/js/commentstabview.js b/apps/comments/js/commentstabview.js index 82244d61e9acc..fe3695569bfb5 100644 --- a/apps/comments/js/commentstabview.js +++ b/apps/comments/js/commentstabview.js @@ -32,7 +32,7 @@ '{{/if}}' + ' ' + '
' + - ' ' + + ' ' + ' ' + '{{#if isEditMode}}' + ' ' + @@ -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; },