summaryrefslogtreecommitdiff
path: root/app/assets
diff options
context:
space:
mode:
authorEric Eastwood <contact@ericeastwood.com>2017-05-22 11:10:01 -0500
committerEric Eastwood <contact@ericeastwood.com>2017-05-22 11:10:01 -0500
commit5563bf9ce6dbdb168be493e1b278bdc2f5752be8 (patch)
treeb83f974d9fa24c25fe29b888d87d90ffd12ee25f /app/assets
parent3c45906bdaed617a0e9446ca9f91222a900eafbb (diff)
downloadgitlab-ce-5563bf9ce6dbdb168be493e1b278bdc2f5752be8.tar.gz
Fix jQuery data attribute caching issue casuing expanding issues
Command | Result $link.data('lineType') | '' $link.data('line-type') | '' $link.attr('data-line-type') | 'new' $link[0].dataset.lineType | 'new'
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/notes.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js
index 62a46733cc4..d2e22af4070 100644
--- a/app/assets/javascripts/notes.js
+++ b/app/assets/javascripts/notes.js
@@ -858,11 +858,12 @@ const normalizeNewlines = function(str) {
Notes.prototype.onAddDiffNote = function(e) {
e.preventDefault();
- const $link = $(e.currentTarget || e.target);
+ const link = e.currentTarget || e.target;
+ const $link = $(link);
const showReplyInput = !$link.hasClass('js-diff-comment-avatar');
this.toggleDiffNote({
target: $link,
- lineType: $link.data('lineType'),
+ lineType: link.dataset.lineType,
showReplyInput
});
};