summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/diff.js
diff options
context:
space:
mode:
authorFelipe Artur <fcardozo@gitlab.com>2017-10-07 04:25:17 +0000
committerJacob Schatz <jschatz@gitlab.com>2017-10-07 04:25:17 +0000
commitb54203f0ada8f7ad6d24437b6f5f46ebf43f8695 (patch)
treeb903596b4755da406dfd1349a8b2c59a5f38b9d1 /app/assets/javascripts/diff.js
parentb4f9dc48163c065d776d120dd312c689ce79f653 (diff)
downloadgitlab-ce-b54203f0ada8f7ad6d24437b6f5f46ebf43f8695.tar.gz
Commenting on image diffs
Diffstat (limited to 'app/assets/javascripts/diff.js')
-rw-r--r--app/assets/javascripts/diff.js5
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)