add bookmark collection editor
This commit is contained in:
18
data/static/js/bits/collections-editor.js
Normal file
18
data/static/js/bits/collections-editor.js
Normal file
@@ -0,0 +1,18 @@
|
||||
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};`
|
||||
}
|
||||
Reference in New Issue
Block a user