mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +00:00
ChillCollectionType: fix bug when adding 2 new items in an empty collection
This commit is contained in:
parent
e46220ff72
commit
d205939361
@ -50,7 +50,7 @@ var handleAdd = function(button) {
|
|||||||
empty_explain = collection.querySelector('li[data-collection-empty-explain]'),
|
empty_explain = collection.querySelector('li[data-collection-empty-explain]'),
|
||||||
entry = document.createElement('li'),
|
entry = document.createElement('li'),
|
||||||
event = new CustomEvent('collection-add-entry', { detail: { collection: collection, entry: entry } }),
|
event = new CustomEvent('collection-add-entry', { detail: { collection: collection, entry: entry } }),
|
||||||
counter = collection.childNodes.length,
|
counter = collection.childNodes.length + parseInt(Math.random() * 1000000)
|
||||||
content
|
content
|
||||||
;
|
;
|
||||||
content = prototype.replace(new RegExp('__name__', 'g'), counter);
|
content = prototype.replace(new RegExp('__name__', 'g'), counter);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user