up
This commit is contained in:
parent
3409091557
commit
a972bcbeec
@ -85,12 +85,3 @@ function hide(target){
|
||||
document.addEventListener("htmx:afterOnLoad", function (event) {
|
||||
// console.log("Réponse du serveur :", event.detail.xhr.responseText);
|
||||
});
|
||||
document.querySelectorAll('.path-link').forEach(el=>{
|
||||
el.addEventListener('click', e=>{
|
||||
e.preventDefault();
|
||||
let id = el.dataset.id;
|
||||
fetch('/api/paths/'+id+'/media')
|
||||
.then(r=>r.text())
|
||||
.then(html=> document.getElementById('content').innerHTML = html);
|
||||
});
|
||||
});
|
||||
|
||||
@ -32,12 +32,18 @@
|
||||
<ul id="paths-list">
|
||||
{{range .paths}}
|
||||
<li>
|
||||
<a href="#" class="path-link" data-id="{{.ID}}">
|
||||
<a
|
||||
href="/api/paths/{{.ID}}/media"
|
||||
class="path-link"
|
||||
hx-get="/api/paths/{{.ID}}/media"
|
||||
hx-target="#content"
|
||||
hx-swap="innerHTML">
|
||||
{{.PathName}}
|
||||
<i class="fas fa-ellipsis-v"></i>
|
||||
</a>
|
||||
</li>
|
||||
{{end}}
|
||||
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user