fix: hide collapse in edit mode and fix workspace links
This commit is contained in:
parent
5a5f8924bf
commit
02464be6a6
2 changed files with 10 additions and 3 deletions
|
|
@ -200,7 +200,14 @@ frappe.ui.Sidebar = class Sidebar {
|
|||
}
|
||||
make_sidebar() {
|
||||
this.empty();
|
||||
this.wrapper.find(".collapse-sidebar-link").removeClass("hidden");
|
||||
|
||||
// Display collapse button when sidebar is not in edit mode
|
||||
if (!this.edit_mode) {
|
||||
this.wrapper.find(".collapse-sidebar-link").removeClass("hidden");
|
||||
} else {
|
||||
this.wrapper.find(".collapse-sidebar-link").addClass("hidden");
|
||||
}
|
||||
|
||||
this.create_sidebar(this.workspace_sidebar_items);
|
||||
|
||||
// Scroll sidebar to selected page if it is not in viewport.
|
||||
|
|
@ -808,7 +815,7 @@ frappe.ui.Sidebar = class Sidebar {
|
|||
const me = this;
|
||||
this.save_sidebar_button = this.wrapper.find(".save-sidebar");
|
||||
this.discard_button = this.wrapper.find(".discard-button");
|
||||
this.save_sidebar_button.on("click", async function (event) {
|
||||
this.save_sidebar_button.off("click").on("click", async function (event) {
|
||||
frappe.show_alert({
|
||||
message: __("Saving Sidebar"),
|
||||
indicator: "success",
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ frappe.ui.SidebarHeader = class SidebarHeader {
|
|||
icon: "wallpaper",
|
||||
url: frappe.utils.generate_route({
|
||||
type: "Workspace",
|
||||
route: w.toLowerCase(),
|
||||
route: frappe.router.slug(w),
|
||||
}),
|
||||
};
|
||||
sibling_workspaces.push(item);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue