diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2017-12-07 11:09:17 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2017-12-07 11:09:17 +0000 |
commit | 139ce1c44587f6920cdb1982c33714ff6cf910b7 (patch) | |
tree | 53ce16d2c35b7fa711c860f8eb0ed810a93e9b8c /app/assets/javascripts/merge_request_tabs.js | |
parent | f1a98477014ceee1738a6994da9fd17dd4ccea00 (diff) | |
download | gitlab-ce-139ce1c44587f6920cdb1982c33714ff6cf910b7.tar.gz |
Export date utility functions as ES6 modules
Diffstat (limited to 'app/assets/javascripts/merge_request_tabs.js')
-rw-r--r-- | app/assets/javascripts/merge_request_tabs.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/app/assets/javascripts/merge_request_tabs.js b/app/assets/javascripts/merge_request_tabs.js index 54c1b7a268e..870b0e41a80 100644 --- a/app/assets/javascripts/merge_request_tabs.js +++ b/app/assets/javascripts/merge_request_tabs.js @@ -13,6 +13,9 @@ import { } from './lib/utils/common_utils'; import initDiscussionTab from './image_diff/init_discussion_tab'; import Diff from './diff'; +import { + localTimeAgo, +} from './lib/utils/datetime_utility'; /* eslint-disable max-len */ // MergeRequestTabs @@ -246,7 +249,7 @@ import Diff from './diff'; url: `${source}.json`, success: (data) => { document.querySelector('div#commits').innerHTML = data.html; - gl.utils.localTimeAgo($('.js-timeago', 'div#commits')); + localTimeAgo($('.js-timeago', 'div#commits')); this.commitsLoaded = true; this.scrollToElement('#commits'); }, @@ -293,7 +296,7 @@ import Diff from './diff'; gl.diffNotesCompileComponents(); } - gl.utils.localTimeAgo($('.js-timeago', 'div#diffs')); + localTimeAgo($('.js-timeago', 'div#diffs')); $('#diffs .js-syntax-highlight').syntaxHighlight(); if (this.diffViewType() === 'parallel' && this.isDiffAction(this.currentAction)) { @@ -317,7 +320,7 @@ import Diff from './diff'; // Scroll any linked note into view // Similar to `toggler_behavior` in the discussion tab - const hash = window.gl.utils.getLocationHash(); + const hash = gl.utils.getLocationHash(); const anchor = hash && $container.find(`.note[id="${hash}"]`); if (anchor && anchor.length > 0) { const notesContent = anchor.closest('.notes_content'); |