Instantiate ImageFile for diff-files in Diff

This commit is contained in:
Luke "Jared" Bennett 2016-12-04 11:12:23 +00:00
parent 0819d093e9
commit c3415873b9
No known key found for this signature in database
GPG key ID: 402ED51FB5D306C2
4 changed files with 11 additions and 4 deletions

View file

@ -3,7 +3,7 @@
this.CommitFile = (function() {
function CommitFile(file) {
if ($('.image', file).length) {
new ImageFile(file);
new gl.ImageFile(file);
}
}

View file

@ -1,6 +1,6 @@
/* eslint-disable func-names, space-before-function-paren, wrap-iife, no-var, no-use-before-define, prefer-arrow-callback, no-else-return, consistent-return, prefer-template, quotes, one-var, one-var-declaration-per-line, no-unused-vars, no-return-assign, comma-dangle, quote-props, no-unused-expressions, no-sequences, object-shorthand, padded-blocks, max-len */
(function() {
this.ImageFile = (function() {
gl.ImageFile = (function() {
var prepareFrames;
// Width where images must fits in, for 2-up this gets divided by 2

View file

@ -5,8 +5,11 @@
class Diff {
constructor() {
$('.files .diff-file').singleFileDiff();
$('.files .diff-file').filesCommentButton();
const $diffFile = $('.files .diff-file');
$diffFile.singleFileDiff();
$diffFile.filesCommentButton();
$diffFile.each((index, file) => new gl.ImageFile(file));
if (this.diffViewType() === 'parallel') {
$('.content-wrapper .container-fluid').removeClass('container-limited');

View file

@ -0,0 +1,4 @@
---
title: Add image controls to MR diffs
merge_request: 7919
author: