mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 01:25:55 +02:00
Fixed some issues when navigating back in history with Turbo.
This commit is contained in:
parent
e26f6e5394
commit
ab179a8b71
2 changed files with 8 additions and 3 deletions
|
@ -16,6 +16,7 @@ class RegisterEventHelper {
|
|||
}
|
||||
|
||||
registerLoadHandler(fn) {
|
||||
document.addEventListener('turbo:render', fn);
|
||||
document.addEventListener('turbo:load', fn);
|
||||
}
|
||||
|
||||
|
@ -38,7 +39,7 @@ class RegisterEventHelper {
|
|||
registerSpecialCharInput() {
|
||||
this.registerLoadHandler(() => {
|
||||
//@ts-ignore
|
||||
$("input[type=text], textarea, input[type=search]").unbind("keydown").keydown(function (event) {
|
||||
$("input[type=text], input[type=search]").unbind("keydown").keydown(function (event) {
|
||||
let greek = event.altKey;
|
||||
|
||||
let greek_char = "";
|
||||
|
|
|
@ -27,7 +27,8 @@ class TristateHelper {
|
|||
|
||||
registerTriStateCheckboxes() {
|
||||
//Initialize tristate checkboxes and if needed the multicheckbox functionality
|
||||
document.addEventListener("turbo:load", () => {
|
||||
|
||||
const listener = () => {
|
||||
$(".tristate").tristate( {
|
||||
checked: "true",
|
||||
unchecked: "false",
|
||||
|
@ -44,7 +45,10 @@ class TristateHelper {
|
|||
//@ts-ignore
|
||||
$('.tristate:checkbox', $row).tristate('state', new_state);
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
document.addEventListener("turbo:load", listener);
|
||||
document.addEventListener("turbo:render", listener);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue