Skip to content

Commit

Permalink
NGSTACK-922 add missing unary + operator in front of date, add event …
Browse files Browse the repository at this point in the history
…listener for remove button on existing elements
  • Loading branch information
hknezevic committed Nov 7, 2024
1 parent 95d9c88 commit 5cad46d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bundle/Resources/public/admin/js/multientry.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class MultiEntry {
}

next_id() {
const timestamp = new Date();
const timestamp = +new Date();

return `${timestamp}${this.id++}`;
}
Expand All @@ -86,6 +86,9 @@ class MultiEntry {
setup_dom() {
this.$element.querySelectorAll(SELECTORS.item).forEach(($item) => {
$item.append(MultiEntry.create_element_from_string(this.remove_button_template));
$item.querySelector(SELECTORS.remove_button).addEventListener('click', () => {
this.remove($item);
});
});
}

Expand Down

0 comments on commit 5cad46d

Please sign in to comment.