summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/merge_request_tabs.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/merge_request_tabs.js')
-rw-r--r--app/assets/javascripts/merge_request_tabs.js9
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');