mirror of
https://github.com/45Drives/cockpit-navigator.git
synced 2025-07-30 00:55:30 +02:00
fix keydown evt handler for nav window
This commit is contained in:
parent
cf9f7f012a
commit
1033593d14
@ -526,6 +526,7 @@ class NavFile extends NavEntry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async show_edit_file_contents() {
|
async show_edit_file_contents() {
|
||||||
|
window.removeEventListener("keydown", this.nav_window_ref);
|
||||||
this.nav_window_ref.disable_buttons_for_editing();
|
this.nav_window_ref.disable_buttons_for_editing();
|
||||||
var contents = "";
|
var contents = "";
|
||||||
try {
|
try {
|
||||||
@ -560,6 +561,7 @@ class NavFile extends NavEntry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
hide_edit_file_contents() {
|
hide_edit_file_contents() {
|
||||||
|
window.addEventListener("keydown", this.nav_window_ref);
|
||||||
document.getElementById("nav-edit-contents-textarea").removeEventListener("keydown", this);
|
document.getElementById("nav-edit-contents-textarea").removeEventListener("keydown", this);
|
||||||
document.getElementById("nav-edit-contents-view").style.display = "none";
|
document.getElementById("nav-edit-contents-view").style.display = "none";
|
||||||
document.getElementById("nav-contents-view").style.display = "flex";
|
document.getElementById("nav-contents-view").style.display = "flex";
|
||||||
@ -622,6 +624,7 @@ class NavFileLink extends NavFile{
|
|||||||
}
|
}
|
||||||
|
|
||||||
async show_edit_file_contents() {
|
async show_edit_file_contents() {
|
||||||
|
window.removeEventListener("keydown", this.nav_window_ref);
|
||||||
this.nav_window_ref.disable_buttons_for_editing();
|
this.nav_window_ref.disable_buttons_for_editing();
|
||||||
document.getElementById("pwd").disabled = true;
|
document.getElementById("pwd").disabled = true;
|
||||||
var target_path = this.get_link_target_path();
|
var target_path = this.get_link_target_path();
|
||||||
@ -1385,7 +1388,7 @@ class NavWindow {
|
|||||||
this.window = document.getElementById("nav-contents-view");
|
this.window = document.getElementById("nav-contents-view");
|
||||||
this.window.addEventListener("click", this);
|
this.window.addEventListener("click", this);
|
||||||
this.window.addEventListener("contextmenu", this);
|
this.window.addEventListener("contextmenu", this);
|
||||||
this.window.addEventListener("keydown", this);
|
window.addEventListener("keydown", this);
|
||||||
this.last_selected_index = -1;
|
this.last_selected_index = -1;
|
||||||
|
|
||||||
this.context_menu = new NavContextMenu("nav-context-menu", this);
|
this.context_menu = new NavContextMenu("nav-context-menu", this);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user