Merge pull request #37926 from sokumon/header-icon
This commit is contained in:
commit
b0995bd4a0
5 changed files with 32 additions and 12 deletions
|
|
@ -10,6 +10,7 @@
|
|||
"action",
|
||||
"hidden",
|
||||
"is_standard",
|
||||
"icon",
|
||||
"column_break_dtwu",
|
||||
"condition"
|
||||
],
|
||||
|
|
@ -72,19 +73,25 @@
|
|||
{
|
||||
"fieldname": "column_break_dtwu",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "icon",
|
||||
"fieldtype": "Icon",
|
||||
"label": "Icon"
|
||||
}
|
||||
],
|
||||
"istable": 1,
|
||||
"links": [],
|
||||
"modified": "2024-11-15 14:12:19.803995",
|
||||
"modified": "2026-03-11 12:23:02.473404",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Core",
|
||||
"name": "Navbar Item",
|
||||
"owner": "Administrator",
|
||||
"permissions": [],
|
||||
"quick_entry": 1,
|
||||
"row_format": "Dynamic",
|
||||
"sort_field": "creation",
|
||||
"sort_order": "DESC",
|
||||
"states": [],
|
||||
"track_changes": 1
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ class Picker {
|
|||
}
|
||||
}
|
||||
setup_emojis() {
|
||||
console.log("Making emojis");
|
||||
// setup tab
|
||||
this.setup_tab();
|
||||
// setup emoji container
|
||||
|
|
|
|||
|
|
@ -52,12 +52,11 @@ frappe.ui.menu = class ContextMenu {
|
|||
function () {
|
||||
return true;
|
||||
};
|
||||
console.log(typeof item.condition);
|
||||
let render = false;
|
||||
if (typeof item.condition == "function") {
|
||||
render = item.condition();
|
||||
} else {
|
||||
render = frappe.utils.eval_expression(item.condition);
|
||||
render = frappe.utils.eval(item.condition);
|
||||
}
|
||||
if (render) {
|
||||
this.add_menu_item(item);
|
||||
|
|
|
|||
|
|
@ -24,6 +24,17 @@ frappe.ui.SidebarHeader = class SidebarHeader {
|
|||
},
|
||||
items: this.sibling_workspaces,
|
||||
},
|
||||
{
|
||||
name: "website",
|
||||
label: __("Website"),
|
||||
icon: "web",
|
||||
onClick: function () {
|
||||
window.open(window.location.origin);
|
||||
},
|
||||
},
|
||||
{
|
||||
is_divider: true,
|
||||
},
|
||||
{
|
||||
name: "edit-sidebar",
|
||||
label: __("Edit Sidebar"),
|
||||
|
|
@ -36,11 +47,9 @@ frappe.ui.SidebarHeader = class SidebarHeader {
|
|||
},
|
||||
},
|
||||
{
|
||||
name: "website",
|
||||
label: __("Website"),
|
||||
icon: "web",
|
||||
onClick: function () {
|
||||
window.open(window.location.origin);
|
||||
is_divider: true,
|
||||
condition: function () {
|
||||
return frappe.boot.developer_mode;
|
||||
},
|
||||
},
|
||||
];
|
||||
|
|
@ -77,6 +86,9 @@ frappe.ui.SidebarHeader = class SidebarHeader {
|
|||
icon: "info",
|
||||
items: this.get_help_siblings(),
|
||||
},
|
||||
{
|
||||
is_divider: true,
|
||||
},
|
||||
{
|
||||
name: "logout",
|
||||
label: "Logout",
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
.dropdown-menu-item {
|
||||
// padding: var(--padding-xs);
|
||||
border-radius: var(--border-radius-sm);
|
||||
&:hover {
|
||||
&:hover:has(a) {
|
||||
background-color: var(--sidebar-hover-color);
|
||||
}
|
||||
|
||||
|
|
@ -37,7 +37,10 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.dropdown-divider {
|
||||
margin-right: calc(var(--margin-xs) + 3px);
|
||||
margin-left: calc(var(--margin-xs) + 3px);
|
||||
}
|
||||
.menu-item-title {
|
||||
text-overflow: ellipsis;
|
||||
text-wrap: nowrap;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue