Hi all!
I have customized dropdown menu in Desk in app/navbar-settings
But in website it looks different:
How can I customize my dropdown menu in website?
my Frappe Framework is v15.86.0
Hi all!
I have customized dropdown menu in Desk in app/navbar-settings
But in website it looks different:
How can I customize my dropdown menu in website?
my Frappe Framework is v15.86.0
(() => {
const menu = document.querySelector(
'ul.dropdown-menu.dropdown-menu-right.show'
);
if (!menu) {
console.error("User dropdown not found. Open the menu first.");
return;
}
// Prevent duplicate insert
if (menu.querySelector('[data-custom-btn]')) {
console.warn("Button already added");
return;
}
const li = document.createElement("a");
li.className = "dropdown-item";
li.setAttribute("data-custom-btn", "1");
li.innerHTML = "My Custom Button";
li.addEventListener("click", () => {
alert("Custom button clicked");
// frappe.set_route("List", "Sales Order");
// window.location.href = "/app/sales-order";
});
menu.appendChild(li);
})();