aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2017-11-26 23:45:35 +0100
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2017-11-27 00:05:54 +0100
commit8eb19a278c1667b4c8679076b21c1e5e08a77e9d (patch)
tree09e36e3fdd4955a7d17c47887ebc9c00f31f8973
parent107952ff0095e93691a3e0b546ead347dfc5d39c (diff)
downloadnextcloud-server-8eb19a278c1667b4c8679076b21c1e5e08a77e9d.tar.gz
nextcloud-server-8eb19a278c1667b4c8679076b21c1e5e08a77e9d.zip
Disable contacts menu for mentioned users in comments being composed
The contacts menu does not provide too much value for users mentioned in a message being composed, so it is now disabled in this case. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
-rw-r--r--apps/comments/css/comments.css4
-rw-r--r--apps/comments/js/commentstabview.js17
2 files changed, 14 insertions, 7 deletions
diff --git a/apps/comments/css/comments.css b/apps/comments/css/comments.css
index 14fa4316b5a..16855749268 100644
--- a/apps/comments/css/comments.css
+++ b/apps/comments/css/comments.css
@@ -127,8 +127,8 @@
position: relative;
}
-#commentsTabView .comment .message .avatar-name-wrapper,
-#commentsTabView .comment .message .avatar-name-wrapper .avatar,
+#commentsTabView .comment:not(.newCommentRow) .message .avatar-name-wrapper,
+#commentsTabView .comment:not(.newCommentRow) .message .avatar-name-wrapper .avatar,
#commentsTabView .comment .authorRow .avatar:not(.currentUser),
#commentsTabView .comment .authorRow .author:not(.currentUser) {
cursor: pointer;
diff --git a/apps/comments/js/commentstabview.js b/apps/comments/js/commentstabview.js
index c9fcc72e284..867072c4665 100644
--- a/apps/comments/js/commentstabview.js
+++ b/apps/comments/js/commentstabview.js
@@ -214,13 +214,15 @@
searchKey: "label"
});
$target.on('inserted.atwho', function (je, $el) {
+ var editionMode = true;
s._postRenderItem(
// we need to pass the parent of the inserted element
// passing the whole comments form would re-apply and request
// avatars from the server
$(je.target).find(
'div[data-username="' + $el.find('[data-username]').data('username') + '"]'
- ).parent()
+ ).parent(),
+ editionMode
);
});
},
@@ -377,7 +379,7 @@
});
},
- _postRenderItem: function($el) {
+ _postRenderItem: function($el, editionMode) {
$el.find('.has-tooltip').tooltip();
$el.find('.avatar').each(function() {
var $this = $(this);
@@ -395,10 +397,14 @@
// it is the case when writing a comment and mentioning a person
$message = $el;
}
- this._postRenderMessage($message);
+ this._postRenderMessage($message, editionMode);
},
- _postRenderMessage: function($el) {
+ _postRenderMessage: function($el, editionMode) {
+ if (editionMode) {
+ return;
+ }
+
$el.find('.avatar').each(function() {
var avatar = $(this);
var strong = $(this).next();
@@ -486,7 +492,8 @@
.html(this._formatMessage(commentToEdit.get('message'), commentToEdit.get('mentions')))
.find('.avatar')
.each(function () { $(this).avatar(); });
- this._postRenderItem($message);
+ var editionMode = true;
+ this._postRenderItem($message, editionMode);
// Enable autosize
autosize($formRow.find('.message'));