diff options
author | Eric Eastwood <contact@ericeastwood.com> | 2017-05-22 11:10:01 -0500 |
---|---|---|
committer | Eric Eastwood <contact@ericeastwood.com> | 2017-05-22 11:10:01 -0500 |
commit | 5563bf9ce6dbdb168be493e1b278bdc2f5752be8 (patch) | |
tree | b83f974d9fa24c25fe29b888d87d90ffd12ee25f /app/assets | |
parent | 3c45906bdaed617a0e9446ca9f91222a900eafbb (diff) | |
download | gitlab-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.js | 5 |
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 }); }; |