2017-04-06 01:13:06 +00:00
|
|
|
import Vue from 'vue';
|
2017-05-10 11:29:33 +00:00
|
|
|
import issuableApp from './components/app.vue';
|
2017-04-06 01:13:06 +00:00
|
|
|
import '../vue_shared/vue_resource_interceptor';
|
|
|
|
|
2017-05-10 11:29:33 +00:00
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
|
|
const issuableElement = document.getElementById('js-issuable-app');
|
|
|
|
const issuableTitleElement = issuableElement.querySelector('.title');
|
|
|
|
const issuableDescriptionElement = issuableElement.querySelector('.wiki');
|
|
|
|
const issuableDescriptionTextarea = issuableElement.querySelector('.js-task-list-field');
|
|
|
|
const {
|
|
|
|
canUpdate,
|
|
|
|
endpoint,
|
|
|
|
issuableRef,
|
|
|
|
} = issuableElement.dataset;
|
2017-04-06 01:13:06 +00:00
|
|
|
|
2017-05-10 11:29:33 +00:00
|
|
|
return new Vue({
|
|
|
|
el: issuableElement,
|
|
|
|
components: {
|
|
|
|
issuableApp,
|
|
|
|
},
|
|
|
|
render: createElement => createElement('issuable-app', {
|
2017-04-15 15:11:04 +00:00
|
|
|
props: {
|
2017-05-10 11:29:33 +00:00
|
|
|
canUpdate: gl.utils.convertPermissionToBoolean(canUpdate),
|
2017-04-15 15:11:04 +00:00
|
|
|
endpoint,
|
2017-05-10 11:29:33 +00:00
|
|
|
issuableRef,
|
|
|
|
initialTitle: issuableTitleElement.innerHTML,
|
|
|
|
initialDescriptionHtml: issuableDescriptionElement ? issuableDescriptionElement.innerHTML : '',
|
|
|
|
initialDescriptionText: issuableDescriptionTextarea ? issuableDescriptionTextarea.textContent : '',
|
2017-04-15 15:11:04 +00:00
|
|
|
},
|
|
|
|
}),
|
|
|
|
});
|
2017-05-10 11:29:33 +00:00
|
|
|
});
|