mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-23 02:09:03 +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) {
|
registerLoadHandler(fn) {
|
||||||
|
document.addEventListener('turbo:render', fn);
|
||||||
document.addEventListener('turbo:load', fn);
|
document.addEventListener('turbo:load', fn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +39,7 @@ class RegisterEventHelper {
|
||||||
registerSpecialCharInput() {
|
registerSpecialCharInput() {
|
||||||
this.registerLoadHandler(() => {
|
this.registerLoadHandler(() => {
|
||||||
//@ts-ignore
|
//@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 = event.altKey;
|
||||||
|
|
||||||
let greek_char = "";
|
let greek_char = "";
|
||||||
|
|
|
@ -27,7 +27,8 @@ class TristateHelper {
|
||||||
|
|
||||||
registerTriStateCheckboxes() {
|
registerTriStateCheckboxes() {
|
||||||
//Initialize tristate checkboxes and if needed the multicheckbox functionality
|
//Initialize tristate checkboxes and if needed the multicheckbox functionality
|
||||||
document.addEventListener("turbo:load", () => {
|
|
||||||
|
const listener = () => {
|
||||||
$(".tristate").tristate( {
|
$(".tristate").tristate( {
|
||||||
checked: "true",
|
checked: "true",
|
||||||
unchecked: "false",
|
unchecked: "false",
|
||||||
|
@ -44,7 +45,10 @@ class TristateHelper {
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
$('.tristate:checkbox', $row).tristate('state', new_state);
|
$('.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