mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-24 00:23:50 +00:00
Merge branch 'upgrade-sf5' into signature-app-master
This commit is contained in:
@@ -53,14 +53,17 @@ export const handleAdd = (button: any): void => {
|
||||
let
|
||||
empty_explain: HTMLLIElement | null = collection.querySelector('li[data-collection-empty-explain]'),
|
||||
entry = document.createElement('li'),
|
||||
counter = collection.childNodes.length + 1,
|
||||
content = prototype.replace(new RegExp('__name__', 'g'), counter.toString()),
|
||||
counter = collection.querySelectorAll('li.entry').length, // Updated counter logic
|
||||
content = prototype.replace(/__name__/g, counter.toString()),
|
||||
event = new CustomEvent('collection-add-entry', {detail: new CollectionEventPayload(collection, entry)});
|
||||
|
||||
console.log(counter)
|
||||
console.log(content)
|
||||
|
||||
entry.innerHTML = content;
|
||||
entry.classList.add('entry');
|
||||
|
||||
if ("dataCollectionRegular" in collection.dataset) {
|
||||
if ("collectionRegular" in collection.dataset) {
|
||||
initializeRemove(collection, entry);
|
||||
if (empty_explain !== null) {
|
||||
empty_explain.remove();
|
||||
|
@@ -159,3 +159,5 @@ document.addEventListener('DOMContentLoaded', function(e) {
|
||||
loadDynamicPicker(document)
|
||||
})
|
||||
|
||||
window.loadDynamicPicker = loadDynamicPicker;
|
||||
|
||||
|
Reference in New Issue
Block a user