Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

53 has to remove the remove button for the imcome #54

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified assets/controllers/username_validation_controller.js
100644 → 100755
Empty file.
13 changes: 5 additions & 8 deletions assets/js/imcome-multiple.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ document.addEventListener('turbo:load', function () {

// Append the new form group to the collectionHolder
collectionHolder.appendChild(formGroup);

// Optionally: add a remove button to the newItem and attach event handler
addRemoveButton(formGroup);
if (index > 0) {
// Optionally: add a remove button to the newItem and attach event handler
addRemoveButton(formGroup);
}
});

function addRemoveButton(item) {

// Create the remove button
var removeButton = document.createElement('button');
removeButton.textContent = 'Supprimer';
Expand All @@ -54,11 +56,6 @@ document.addEventListener('turbo:load', function () {
});
}

// Optionally: Setup an initial "remove" button on existing items
var existingItems = collectionHolder.querySelectorAll('.imcome-entry');
existingItems.forEach(function (item) {
addRemoveButton(item);
});
}
});

Loading
Loading