diff options
author | Felipe Artur <fcardozo@gitlab.com> | 2017-10-07 04:25:17 +0000 |
---|---|---|
committer | Jacob Schatz <jschatz@gitlab.com> | 2017-10-07 04:25:17 +0000 |
commit | b54203f0ada8f7ad6d24437b6f5f46ebf43f8695 (patch) | |
tree | b903596b4755da406dfd1349a8b2c59a5f38b9d1 /app/assets/javascripts/diff.js | |
parent | b4f9dc48163c065d776d120dd312c689ce79f653 (diff) | |
download | gitlab-ce-b54203f0ada8f7ad6d24437b6f5f46ebf43f8695.tar.gz |
Commenting on image diffs
Diffstat (limited to 'app/assets/javascripts/diff.js')
-rw-r--r-- | app/assets/javascripts/diff.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/assets/javascripts/diff.js b/app/assets/javascripts/diff.js index 9ddfdb6ae21..6c78662baa7 100644 --- a/app/assets/javascripts/diff.js +++ b/app/assets/javascripts/diff.js @@ -3,6 +3,7 @@ import './lib/utils/url_utility'; import FilesCommentButton from './files_comment_button'; import SingleFileDiff from './single_file_diff'; +import imageDiffHelper from './image_diff/helpers/index'; const UNFOLD_COUNT = 20; let isBound = false; @@ -20,7 +21,9 @@ class Diff { const tab = document.getElementById('diffs'); if (!tab || (tab && tab.dataset && tab.dataset.isLocked !== '')) FilesCommentButton.init($diffFile); - $diffFile.each((index, file) => new gl.ImageFile(file)); + const firstFile = $('.files').first().get(0); + const canCreateNote = firstFile && firstFile.hasAttribute('data-can-create-note'); + $diffFile.each((index, file) => imageDiffHelper.initImageDiff(file, canCreateNote)); if (!isBound) { $(document) |