Update interface.html to add confirmation before track delete
Instead of showing another popup for track delete confirmation, it now simply changes the button text to “Confirm Delete” for 3 seconds and a second tap will actually perform the delete.master
parent
ae661f30de
commit
78eca5030a
|
|
@ -829,11 +829,29 @@ ${trackData.Latitude ? `
|
|||
|
||||
switch(task) {
|
||||
case "delete":
|
||||
if (button.dataset.confirmDelete === "true") {
|
||||
// Second click - proceed with deletion
|
||||
Util.showModal(`Deleting ${filename}...`);
|
||||
Util.eraseStorageFile(filename, () => {
|
||||
Util.hideModal();
|
||||
getTrackList();
|
||||
});
|
||||
} else {
|
||||
// First click - change to confirm state
|
||||
const originalText = button.textContent;
|
||||
button.textContent = "Confirm Delete";
|
||||
button.classList.add("btn-error");
|
||||
button.dataset.confirmDelete = "true";
|
||||
|
||||
// Reset after 3 seconds
|
||||
setTimeout(() => {
|
||||
if (button.dataset.confirmDelete === "true") {
|
||||
button.textContent = originalText;
|
||||
button.classList.remove("btn-error");
|
||||
delete button.dataset.confirmDelete;
|
||||
}
|
||||
}, 3000);
|
||||
}
|
||||
break;
|
||||
case "downloadkml":
|
||||
downloadTrack(filename, track => saveKML(track, `Bangle.js Track ${trackid}`));
|
||||
|
|
|
|||
Loading…
Reference in New Issue