mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 01:25:55 +02:00
Register the unselect handler on turbo:load instead of visit, to avoid problems that the newly clicked treeview node gets unselected too.
This commit is contained in:
parent
cb9e90ddc9
commit
1b5eea4750
1 changed files with 3 additions and 3 deletions
|
@ -103,7 +103,6 @@ export default class extends Controller {
|
|||
this._registerURLWatcher(node);
|
||||
}
|
||||
},
|
||||
//onNodeContextmenu: contextmenu_handler,
|
||||
}, [BS5Theme, BS53Theme, FAIconTheme]);
|
||||
|
||||
this.treeTarget.addEventListener(EVENT_INITIALIZED, (event) => {
|
||||
|
@ -138,12 +137,13 @@ export default class extends Controller {
|
|||
node.setSelected(false, {silent: true, ignorePreventUnselect: true});
|
||||
|
||||
//Unregister the watcher
|
||||
document.removeEventListener('turbo:visit', unselectNode);
|
||||
document.removeEventListener('turbo:load', unselectNode);
|
||||
}
|
||||
};
|
||||
|
||||
//Register the watcher via hotwire turbo
|
||||
document.addEventListener('turbo:visit', unselectNode);
|
||||
//We must just load to have the new url in window.location
|
||||
document.addEventListener('turbo:load', unselectNode);
|
||||
}
|
||||
|
||||
_onContextMenu(event)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue