| | |
| | | this.currentItemID = itemID; |
| | | |
| | | let item = this.store.get(parseInt(itemID)); |
| | | console.log('Item', item); |
| | | if (item) { |
| | | this.ui.modals.edit.dataset.itemId = itemID; |
| | | this.ui.modals.edit.dataset.content = this.content; |
| | | |
| | | let form = this.ui.modals.edit.querySelector('form'); |
| | | [ |
| | | this.ui.modals.edit.querySelector('h2').textContent |
| | | ] = [ |
| | | `Editing ${item.fields.post_title}` |
| | | ]; |
| | | this.ui.modals.edit.querySelector('h2').textContent = `Editing ${item.fields.post_title}`; |
| | | form.dataset.formId = `edit-${itemID}`; |
| | | console.log('Sending to jvbPopulate: ', item.fields); |
| | | console.log('and images: ', item.images); |
| | | new window.jvbPopulate(form, item.fields, item.images); |
| | | |
| | | new window.jvbPopulate(form, item); |
| | | |
| | | this.formController.registerForm(this.ui.forms.edit); |
| | | } |
| | | } |