debian-mirror-gitlab/app/assets/javascripts/pages/projects/tree/show/index.js

44 lines
1.5 KiB
JavaScript
Raw Normal View History

2018-05-09 12:01:36 +05:30
import $ from 'jquery';
2018-03-17 18:26:18 +05:30
import Vue from 'vue';
2018-03-27 19:54:05 +05:30
import initBlob from '~/blob_edit/blob_bundle';
2018-03-17 18:26:18 +05:30
import commitPipelineStatus from '~/projects/tree/components/commit_pipeline_status_component.vue';
2018-11-18 11:00:15 +05:30
import GpgBadges from '~/gpg_badges';
2018-03-17 18:26:18 +05:30
import TreeView from '../../../../tree';
2018-12-05 23:21:45 +05:30
import ShortcutsNavigation from '../../../../behaviors/shortcuts/shortcuts_navigation';
2018-03-17 18:26:18 +05:30
import BlobViewer from '../../../../blob/viewer';
import NewCommitForm from '../../../../new_commit_form';
import { ajaxGet } from '../../../../lib/utils/common_utils';
2018-03-27 19:54:05 +05:30
document.addEventListener('DOMContentLoaded', () => {
2018-03-17 18:26:18 +05:30
new ShortcutsNavigation(); // eslint-disable-line no-new
new TreeView(); // eslint-disable-line no-new
new BlobViewer(); // eslint-disable-line no-new
new NewCommitForm($('.js-create-dir-form')); // eslint-disable-line no-new
$('#tree-slider').waitForImages(() =>
2018-11-18 11:00:15 +05:30
ajaxGet(document.querySelector('.js-tree-content').dataset.logsPath),
);
2018-03-17 18:26:18 +05:30
2018-03-27 19:54:05 +05:30
initBlob();
2018-03-17 18:26:18 +05:30
const commitPipelineStatusEl = document.querySelector('.js-commit-pipeline-status');
const statusLink = document.querySelector('.commit-actions .ci-status-link');
if (statusLink != null) {
statusLink.remove();
// eslint-disable-next-line no-new
new Vue({
el: commitPipelineStatusEl,
components: {
commitPipelineStatus,
},
render(createElement) {
return createElement('commit-pipeline-status', {
props: {
endpoint: commitPipelineStatusEl.dataset.endpoint,
},
});
},
});
}
2018-11-18 11:00:15 +05:30
GpgBadges.fetch();
2018-03-27 19:54:05 +05:30
});