mirror of
https://github.com/getnamingo/registry.git
synced 2025-06-25 13:50:45 +02:00
Bugfix
This commit is contained in:
parent
e5d2bd9537
commit
977842e2ba
2 changed files with 2 additions and 20 deletions
|
@ -5,14 +5,9 @@
|
|||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf-autotable/3.6.0/jspdf.plugin.autotable.min.js"></script>
|
||||
<script>
|
||||
var table;
|
||||
document.querySelector("#contactTable").addEventListener('click', function(e) {
|
||||
if (e.target.matches('.delete-btn')) {
|
||||
let id = e.target.getAttribute('data-id');
|
||||
deleteRecord(id);
|
||||
}
|
||||
});
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function(){
|
||||
|
||||
function contactLinkFormatter(cell){
|
||||
var value = cell.getValue();
|
||||
return `<a href="/contact/view/${value}" style="font-weight:bold;">${value}</a>`;
|
||||
|
|
|
@ -7,20 +7,7 @@
|
|||
var table;
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function(){
|
||||
|
||||
document.querySelector("#hostTable").addEventListener('click', function(e) {
|
||||
// Check if the clicked element has the class 'delete-btn' or the ID 'delete-btn'
|
||||
if (e.target.classList.contains('delete-btn') || e.target.id === 'delete-btn') {
|
||||
// Confirmation dialog
|
||||
let confirmDeletion = confirm("Are you sure you want to delete this record?");
|
||||
|
||||
// If user does not confirm, prevent the default action
|
||||
if (!confirmDeletion) {
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function hostLinkFormatter(cell){
|
||||
var value = cell.getValue();
|
||||
return `<a href="/host/view/${value}" style="font-weight:bold;">${value}</a>`;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue