add edit contents button

This commit is contained in:
joshuaboud 2021-10-04 13:53:41 -03:00
parent f706d320be
commit 10a4e91504
No known key found for this signature in database
GPG Key ID: 17EFB59E2A8BF50E
2 changed files with 18 additions and 1 deletions

View File

@ -256,6 +256,9 @@ export class NavWindow {
this.select_one(this.pwd());
this.last_selected_entry = null;
this.update_selection_info();
var edit_btn = document.getElementById("nav-edit-contents-btn");
edit_btn.keep_disabled = edit_btn.disabled = true;
edit_btn.onclick = () => {};
}
/**
@ -282,6 +285,17 @@ export class NavWindow {
this.select_one(target);
}
this.update_selection_info();
var edit_btn = document.getElementById("nav-edit-contents-btn")
if (target.nav_type === "file") {
edit_btn.keep_disabled = edit_btn.disabled = false;
edit_btn.onclick = () => {
target.open();
};
} else {
edit_btn.onclick = () => {};
edit_btn.keep_disabled = edit_btn.disabled = true;
}
}
select_all() {
@ -747,7 +761,8 @@ export class NavWindow {
document.getElementById("nav-loader-container").style.display = "none";
var buttons = document.getElementsByClassName("disable-while-loading");
for (let button of buttons) {
button.disabled = false;
if (!button.keep_disabled)
button.disabled = false;
}
}

View File

@ -102,6 +102,8 @@
<button class="disable-while-loading pf-c-button pf-m-danger" id="nav-delete-btn" title="Delete"><i class="fas fa-trash-alt"></i></button>
<div class="horizontal-spacer"></div>
<button class="disable-while-loading pf-c-button pf-m-primary" id="nav-edit-properties-btn" title="Edit Properties"><i class="fas fa-sliders-h"></i></button>
<div class="horizontal-spacer"></div>
<button class="disable-while-loading pf-c-button pf-m-primary" id="nav-edit-contents-btn" title="Edit Contents"><i class="fas fa-edit"></i></button>
</div>
</div>
<div class="nav-info-column-properties" id="nav-info-column-properties"></div>