up
This commit is contained in:
parent
3409091557
commit
a972bcbeec
@ -85,12 +85,3 @@ function hide(target){
|
|||||||
document.addEventListener("htmx:afterOnLoad", function (event) {
|
document.addEventListener("htmx:afterOnLoad", function (event) {
|
||||||
// console.log("Réponse du serveur :", event.detail.xhr.responseText);
|
// 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">
|
<ul id="paths-list">
|
||||||
{{range .paths}}
|
{{range .paths}}
|
||||||
<li>
|
<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}}
|
{{.PathName}}
|
||||||
<i class="fas fa-ellipsis-v"></i>
|
<i class="fas fa-ellipsis-v"></i>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user