19 lines
420 B
JavaScript
19 lines
420 B
JavaScript
export const b = {}
|
|
|
|
export function addCollection(ev, sender, el) {
|
|
el.innerHTML += b.templates.collectionItem;
|
|
}
|
|
|
|
export function deleteCollection(ev, sender, el) {
|
|
if (!el.contains(sender)) return;
|
|
b.send({ 'id': el.prop('id') }, 'countDeletedCollection');
|
|
el.remove();
|
|
}
|
|
|
|
export function countDeletedCollection(payload, _, el) {
|
|
if (payload.id === 'new') {
|
|
return;
|
|
}
|
|
el.value += `${payload.id};`
|
|
}
|