Commit 504ef7a5 authored by Constance Okoghenun's avatar Constance Okoghenun

Made delete wiki modal component props required and changed the component init behaviour

parent 22651a63
......@@ -10,17 +10,17 @@ export default {
props: {
deleteWikiUrl: {
type: String,
required: false,
required: true,
default: '',
},
pageTitle: {
type: String,
required: false,
required: true,
default: '',
},
csrfToken: {
type: String,
required: false,
required: true,
default: '',
},
},
......
......@@ -14,8 +14,12 @@ document.addEventListener('DOMContentLoaded', () => {
new ZenMode(); // eslint-disable-line no-new
new GLForm($('.wiki-form'), true); // eslint-disable-line no-new
const deleteWikiButton = document.getElementById('delete-wiki-button');
if (deleteWikiButton) {
Vue.use(Translate);
const { deleteWikiUrl, pageTitle } = document.getElementById('delete-wiki-button').dataset;
const { deleteWikiUrl, pageTitle } = deleteWikiButton.dataset;
const deleteWikiModalEl = document.getElementById('delete-wiki-modal');
const deleteModal = new Vue({ // eslint-disable-line
el: deleteWikiModalEl,
......@@ -32,4 +36,5 @@ document.addEventListener('DOMContentLoaded', () => {
});
},
});
}
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment