summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2016-10-11 16:17:51 +0200
committerGitHub <noreply@github.com>2016-10-11 16:17:51 +0200
commit675230f86d74325d41cec4df59578919241934ce (patch)
tree7f9e1f12fa45c94f8d748c5cb30abc6a21240908 /apps
parent9785343d6ac879b5e150b128f97b82e788a2df09 (diff)
parentdcddd4b9d5f2298ccfe302cf7041c2220ac79bee (diff)
downloadnextcloud-server-675230f86d74325d41cec4df59578919241934ce.tar.gz
nextcloud-server-675230f86d74325d41cec4df59578919241934ce.zip
Merge pull request #1407 from nextcloud/multiline_comments
Bring back multiline comments
Diffstat (limited to 'apps')
-rw-r--r--apps/comments/css/comments.css9
-rw-r--r--apps/comments/js/commentstabview.js8
-rw-r--r--apps/comments/tests/js/commentstabviewSpec.js2
3 files changed, 14 insertions, 5 deletions
diff --git a/apps/comments/css/comments.css b/apps/comments/css/comments.css
index 103564c5faf..667f32871bb 100644
--- a/apps/comments/css/comments.css
+++ b/apps/comments/css/comments.css
@@ -21,15 +21,16 @@
width: calc(100% - 81px); /* 36 (left margin) + 30 (right padding) + 15 (right padding of surrounding box) */
margin-left: 36px;
padding-right: 30px;
+ display: block;
}
#commentsTabView .newCommentForm .submit {
position: absolute;
- top: 1px;
+ bottom: 0px;
right: 8px;
width: 30px;
margin: 0;
- padding: 9px;
+ padding: 7px 9px;
background-color: transparent;
border: none;
opacity: .3;
@@ -47,6 +48,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 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;
},
diff --git a/apps/comments/tests/js/commentstabviewSpec.js b/apps/comments/tests/js/commentstabviewSpec.js
index 33c959e430f..470ff0d2217 100644
--- a/apps/comments/tests/js/commentstabviewSpec.js
+++ b/apps/comments/tests/js/commentstabviewSpec.js
@@ -328,7 +328,7 @@ describe('OCA.Comments.CommentsTabView tests', function() {
var $formRow = view.$el.find('.newCommentRow.comment[data-id=1]');
expect($formRow.length).toEqual(1);
- $formRow.find('input').val('modified message');
+ $formRow.find('textarea').val('modified message');
$formRow.find('form').submit();
expect(saveStub.calledOnce).toEqual(true);