diff options
author | Mike Greiling <mike@pixelcog.com> | 2017-07-06 21:39:28 +0300 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-07-06 21:39:28 +0300 |
commit | 5c52ca9a0cc32794b7bb87f1a106bd8d4c287ff9 (patch) | |
tree | 281cbc4215c50b182cd242135fefec38437f0063 /app/assets/javascripts/diff.js | |
parent | a23db42e07d97b6739207808382175f5a53bf748 (diff) |
refactor SingleFileDiff class to ES module syntax
Diffstat (limited to 'app/assets/javascripts/diff.js')
-rw-r--r-- | app/assets/javascripts/diff.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/assets/javascripts/diff.js b/app/assets/javascripts/diff.js index 1be9df19c81..6a008112203 100644 --- a/app/assets/javascripts/diff.js +++ b/app/assets/javascripts/diff.js @@ -2,6 +2,7 @@ import './lib/utils/url_utility'; import FilesCommentButton from './files_comment_button'; +import SingleFileDiff from './single_file_diff'; const UNFOLD_COUNT = 20; let isBound = false; @@ -10,7 +11,11 @@ class Diff { constructor() { const $diffFile = $('.files .diff-file'); - $diffFile.singleFileDiff(); + $diffFile.each((index, file) => { + if (!$.data(file, 'singleFileDiff')) { + $.data(file, 'singleFileDiff', new SingleFileDiff(file)); + } + }); FilesCommentButton.init($diffFile); |