2017-04-06 01:13:06 +00:00
|
|
|
import Vue from 'vue';
|
2017-05-12 09:11:15 +00:00
|
|
|
import eventHub from './event_hub';
|
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-12 09:11:15 +00:00
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
2017-05-15 13:51:40 +00:00
|
|
|
const initialDataEl = document.getElementById('js-issuable-app-initial-data');
|
|
|
|
const initialData = JSON.parse(initialDataEl.innerHTML.replace(/"/g, '"'));
|
2017-05-18 12:24:34 +00:00
|
|
|
|
2017-05-12 09:11:15 +00:00
|
|
|
$('.issuable-edit').on('click', (e) => {
|
|
|
|
e.preventDefault();
|
2017-04-06 01:13:06 +00:00
|
|
|
|
2017-05-12 09:11:15 +00:00
|
|
|
eventHub.$emit('open.form');
|
|
|
|
});
|
|
|
|
|
|
|
|
return new Vue({
|
|
|
|
el: document.getElementById('js-issuable-app'),
|
|
|
|
components: {
|
|
|
|
issuableApp,
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
2017-05-24 11:25:53 +00:00
|
|
|
...initialData,
|
2017-05-12 09:11:15 +00:00
|
|
|
};
|
|
|
|
},
|
|
|
|
render(createElement) {
|
|
|
|
return createElement('issuable-app', {
|
|
|
|
props: {
|
|
|
|
canUpdate: this.canUpdate,
|
2017-05-12 10:58:48 +00:00
|
|
|
canDestroy: this.canDestroy,
|
2017-05-12 09:11:15 +00:00
|
|
|
endpoint: this.endpoint,
|
|
|
|
issuableRef: this.issuableRef,
|
2017-05-24 11:25:53 +00:00
|
|
|
initialTitleHtml: this.initialTitleHtml,
|
|
|
|
initialTitleText: this.initialTitleText,
|
2017-05-12 09:11:15 +00:00
|
|
|
initialDescriptionHtml: this.initialDescriptionHtml,
|
|
|
|
initialDescriptionText: this.initialDescriptionText,
|
2017-05-15 13:51:40 +00:00
|
|
|
issuableTemplates: this.issuableTemplates,
|
2017-08-17 17:25:56 +00:00
|
|
|
markdownPreviewPath: this.markdownPreviewPath,
|
|
|
|
markdownDocsPath: this.markdownDocsPath,
|
2017-05-16 15:18:52 +00:00
|
|
|
projectPath: this.projectPath,
|
|
|
|
projectNamespace: this.projectNamespace,
|
2017-06-02 16:17:54 +00:00
|
|
|
updatedAt: this.updatedAt,
|
|
|
|
updatedByName: this.updatedByName,
|
|
|
|
updatedByPath: this.updatedByPath,
|
2017-06-20 09:56:18 +00:00
|
|
|
initialTaskStatus: this.initialTaskStatus,
|
2017-05-12 09:11:15 +00:00
|
|
|
},
|
|
|
|
});
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|