diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2017-10-19 12:46:43 +0300 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2017-10-19 12:57:25 +0300 |
commit | cf347a5739f31af1f368717b7850d8fbeb48ecd8 (patch) | |
tree | 6d2b1ceb6106fdadb10c64f106431c4d5b18016b /app/assets/javascripts/diff.js | |
parent | 00c15cc27c33dd387069fce5777beb29d01f55ac (diff) |
Remove Diff class from globalnamespace
Diffstat (limited to 'app/assets/javascripts/diff.js')
-rw-r--r-- | app/assets/javascripts/diff.js | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/app/assets/javascripts/diff.js b/app/assets/javascripts/diff.js index 6c78662baa7..c8874e48c09 100644 --- a/app/assets/javascripts/diff.js +++ b/app/assets/javascripts/diff.js @@ -1,5 +1,3 @@ -/* eslint-disable class-methods-use-this */ - import './lib/utils/url_utility'; import FilesCommentButton from './files_comment_button'; import SingleFileDiff from './single_file_diff'; @@ -8,7 +6,7 @@ import imageDiffHelper from './image_diff/helpers/index'; const UNFOLD_COUNT = 20; let isBound = false; -class Diff { +export default class Diff { constructor() { const $diffFile = $('.files .diff-file'); @@ -104,7 +102,7 @@ class Diff { } this.highlightSelectedLine(); } - + // eslint-disable-next-line class-methods-use-this handleParallelLineDown(e) { const line = $(e.currentTarget); const table = line.closest('table'); @@ -116,11 +114,11 @@ class Diff { table.addClass(`${lineClass}-selected`); } } - + // eslint-disable-next-line class-methods-use-this diffViewType() { return $('.inline-parallel-buttons a.active').data('view-type'); } - + // eslint-disable-next-line class-methods-use-this lineNumbers(line) { const children = line.find('.diff-line-num').toArray(); if (children.length !== 2) { @@ -128,7 +126,7 @@ class Diff { } return children.map(elm => parseInt($(elm).data('linenumber'), 10) || 0); } - + // eslint-disable-next-line class-methods-use-this highlightSelectedLine() { const hash = gl.utils.getLocationHash(); const $diffFiles = $('.diff-file'); @@ -141,6 +139,3 @@ class Diff { } } } - -window.gl = window.gl || {}; -window.gl.Diff = Diff; |