diff --git a/client/src/components/NewContentBlockWizard.vue b/client/src/components/NewContentBlockWizard.vue index 963beef9..b930ecbc 100644 --- a/client/src/components/NewContentBlockWizard.vue +++ b/client/src/components/NewContentBlockWizard.vue @@ -9,7 +9,7 @@ class="new-content-block-wizard__element-component" :is="type(element)" :class="{'new-content-block-wizard__chooser': type(element) === 'content-block-chooser-widget'}" - :element="element" :index="index" + :element="element" v-bind="element" :index="index" v-on:change-type="changeType" v-on:link-change-url="changeLinkUrl" v-on:link-change-text="changeLinkText" @@ -79,20 +79,21 @@ } return 'content-block-chooser-widget' }, - updateProperty(value, index, key) { + _updateProperty(value, index, key) { this.elements.splice(index, 1, { ...this.elements[index], [key]: value }); }, changeLinkUrl(value, index) { - this.updateProperty(value, index, 'url') + this._updateProperty(value, index, 'url') }, changeLinkText(value, index) { - this.updateProperty(value, index, 'text') + this._updateProperty(value, index, 'text') }, changeVideoUrl(value, index) { - this.updateProperty(value, index, 'url') + console.log('changing url'); + this._updateProperty(value, index, 'url') }, removeElement(index) { this.elements.splice(index, 1); @@ -129,6 +130,14 @@ data() { return { elements: [ + { + type: 'video', + url: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ' + }, + { + type: 'video', + url: 'https://vimeo.com/267384185' + }, { type: 'link' }, diff --git a/client/src/components/content-forms/VideoForm.vue b/client/src/components/content-forms/VideoForm.vue index ab0a7c61..9803a308 100644 --- a/client/src/components/content-forms/VideoForm.vue +++ b/client/src/components/content-forms/VideoForm.vue @@ -1,14 +1,29 @@ @@ -16,9 +31,32 @@ @@ -56,4 +94,10 @@ } } + + iframe { + width: 100%; + height: 350px; + } + diff --git a/client/src/store/index.js b/client/src/store/index.js index 3a7118bb..a58eb31f 100644 --- a/client/src/store/index.js +++ b/client/src/store/index.js @@ -27,15 +27,14 @@ export default new Vuex.Store({ commit('setSpecialContainerClass', payload); }, hideModal({commit, state}) { - document.body.classList.remove('no-scroll'); + document.body.classList.remove('no-scroll'); // won't get at the body any other way commit('setModal', false); }, showModal({commit}) { - document.body.classList.add('no-scroll'); + document.body.classList.add('no-scroll'); // won't get at the body any other way commit('setModal', true); }, - saveContentBlock({commit}, payload){ - console.log(payload); + saveContentBlock({commit}, payload) { commit('setNewContentBlock', payload); commit('setModal', false); }