Use Turbo.visit for tree clicks

This now seems to work properly and respecting frames
This commit is contained in:
Jan Böhmer 2022-09-25 16:44:41 +02:00
parent cd1602fbc4
commit 6d1d2cd731

View file

@ -70,14 +70,7 @@ export default class extends Controller {
onNodeSelected: (event) => {
const node = event.detail.node;
if (node.href) {
//Simulate a click so we just change the inner frame
let a = document.createElement('a');
a.setAttribute('href', node.href);
a.innerHTML = "";
this.element.appendChild(a);
a.click();
a.remove();
window.Turbo.visit(node.href, {action: "advance"});
}
},
//onNodeContextmenu: contextmenu_handler,