-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrow.html
32 lines (32 loc) · 821 Bytes
/
row.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{{ define "person"}}
<tr>
<td>{{ .Name }}</td>
<td>{{ .Email }}</td>
<td>
<button
class="btn btn-danger"
hx-get="/contact/{{ .Id }}/edit"
hx-trigger="edit"
>
Edit
<script>
me().onclick = async (ev) => {
if (any(".editing")) {
const result = await Swal.fire({
title: "Already editing",
showCancelButton: true,
confirmButtonText: "Yep, Edit This Row!",
text: "Hey! You are already editing a row! Do you want to cancel that edit and continue?",
});
if (!result.isConfirmed) {
return;
}
any(".editing").trigger("cancel");
}
me(ev).trigger("edit");
};
</script>
</button>
</td>
</tr>
{{ end }}