mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-12 17:23:38 +00:00
fix(demo): removed toolbar eventlistener (#52171)
This commit is contained in:
@@ -1,11 +1,5 @@
|
||||
frappe.provide("erpnext.demo");
|
||||
|
||||
$(document).on("toolbar_setup", function () {
|
||||
if (frappe.boot.sysdefaults.demo_company) {
|
||||
render_clear_demo_action();
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on("desktop_screen", function (event, data) {
|
||||
data.desktop.add_menu_item({
|
||||
label: __("Clear Demo Data"),
|
||||
@@ -19,16 +13,6 @@ $(document).on("desktop_screen", function (event, data) {
|
||||
});
|
||||
});
|
||||
|
||||
function render_clear_demo_action() {
|
||||
let demo_action = $(
|
||||
`<a class="dropdown-item" onclick="return erpnext.demo.clear_demo()">
|
||||
${__("Clear Demo Data")}
|
||||
</a>`
|
||||
);
|
||||
|
||||
demo_action.appendTo($("#toolbar-user"));
|
||||
}
|
||||
|
||||
erpnext.demo.clear_demo = function () {
|
||||
frappe.confirm(__("Are you sure you want to clear all demo data?"), () => {
|
||||
frappe.call({
|
||||
|
||||
Reference in New Issue
Block a user