| | |
| | | } |
| | | |
| | | let itemsToRemove = []; |
| | | console.log(data); |
| | | switch (true) { |
| | | case data.config.element === this.ui.forms.edit: |
| | | theChanges[this.currentItemID] = changes; |
| | |
| | | data: { |
| | | posts: changes, |
| | | }, |
| | | delay: true, |
| | | popup: `Saving changes`, |
| | | title: title |
| | | }; |
| | |
| | | console.log(data); |
| | | if (data === this.ui.uploader.querySelector('[data-uploader]')?.dataset.uploader) { |
| | | window.debouncer.schedule('crud-complete', ()=> { |
| | | this.store.clearHttpHeaders(); |
| | | this.store.clearCache(); |
| | | }); |
| | | } |
| | | } |
| | |
| | | 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}`; |
| | | new window.jvbPopulate(form, item.fields, item.images); |
| | | |
| | | new window.jvbPopulate(form, item); |
| | | |
| | | this.formController.registerForm(this.ui.forms.edit); |
| | | } |
| | | } |
| | | |
| | | setupFilters() { |
| | | // Search |
| | | const searchInput = document.querySelector('input[type="search"]'); |
| | | const searchInput = document.querySelector('.all-filters input[type="search"]'); |
| | | if (searchInput) { |
| | | let searchTimeout; |
| | | searchInput.addEventListener('input', () => { |