use pick dynamic user type for reassigning + layout stuffs

This commit is contained in:
2022-05-02 15:37:23 +02:00
parent 0ec859e345
commit 8113fddcb2
7 changed files with 92 additions and 79 deletions

View File

@@ -51,9 +51,7 @@ function loadDynamicPicker(element) {
},
methods: {
addNewEntity(entity) {
console.log('addNewEntity', entity);
if (this.multiple) {
console.log('adding multiple');
if (!this.picked.some(el => {
return el.type === entity.type && el.id === entity.id;
})) {
@@ -71,7 +69,6 @@ function loadDynamicPicker(element) {
}
},
removeEntity(entity) {
console.log('removeEntity', entity);
this.picked = this.picked.filter(e => !(e.type === entity.type && e.id === entity.id));
input.value = JSON.stringify(this.picked);
},
@@ -86,7 +83,6 @@ function loadDynamicPicker(element) {
document.addEventListener('show-hide-show', function(e) {
console.log('creation event caught')
loadDynamicPicker(e.detail.container)
})
@@ -94,17 +90,14 @@ document.addEventListener('show-hide-hide', function(e) {
console.log('hiding event caught')
e.detail.container.querySelectorAll('[data-module="pick-dynamic"]').forEach((el) => {
let uniqId = el.dataset.uniqid;
console.log(uniqId);
if (appsOnPage.has(uniqId)) {
appsOnPage.get(uniqId).unmount();
console.log('App has been unmounted')
appsOnPage.delete(uniqId);
}
})
})
document.addEventListener('DOMContentLoaded', function(e) {
console.log('loaded event', e)
loadDynamicPicker(document)
})