diff options
Diffstat (limited to 'app/assets/javascripts/commit/image_file.js')
-rw-r--r-- | app/assets/javascripts/commit/image_file.js | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/app/assets/javascripts/commit/image_file.js b/app/assets/javascripts/commit/image_file.js index b70f8d6e736..5f24a3c370a 100644 --- a/app/assets/javascripts/commit/image_file.js +++ b/app/assets/javascripts/commit/image_file.js @@ -28,7 +28,7 @@ export default class ImageFile { initViewModes() { const viewMode = viewModes[0]; $('.view-modes', this.file).removeClass('gl-display-none'); - $('.view-modes-menu', this.file).on('click', 'li', event => { + $('.view-modes-menu', this.file).on('click', 'li', (event) => { if (!$(event.currentTarget).hasClass('active')) { return this.activateViewMode(event.currentTarget.className); } @@ -56,15 +56,15 @@ export default class ImageFile { let dragging = false; const $body = $('body'); const $offsetEl = $el.parent(); - const dragStart = function() { + const dragStart = function () { dragging = true; $body.css('user-select', 'none'); }; - const dragStop = function() { + const dragStop = function () { dragging = false; $body.css('user-select', ''); }; - const dragMove = function(e) { + const dragMove = function (e) { const moveX = e.pageX || e.touches[0].pageX; const left = moveX - ($offsetEl.offset().left + padding); if (!dragging) return; @@ -73,11 +73,7 @@ export default class ImageFile { }; // eslint-disable-next-line @gitlab/no-global-event-off - $el - .off('mousedown') - .off('touchstart') - .on('mousedown', dragStart) - .on('touchstart', dragStart); + $el.off('mousedown').off('touchstart').on('mousedown', dragStart).on('touchstart', dragStart); // eslint-disable-next-line @gitlab/no-global-event-off $body @@ -109,9 +105,9 @@ export default class ImageFile { } views = { - 'two-up': function() { + 'two-up': function () { return $('.two-up.view .wrap', this.file).each((index, wrap) => { - $('img', wrap).each(function() { + $('img', wrap).each(function () { const currentWidth = $(this).width(); if (currentWidth > availWidth / 2) { return $(this).width(availWidth / 2); @@ -157,7 +153,7 @@ export default class ImageFile { }); }); }, - 'onion-skin': function() { + 'onion-skin': function () { let maxHeight, maxWidth; maxWidth = 0; maxHeight = 0; |