diff --git a/frappe/public/css/common.css b/frappe/public/css/common.css index e1883eed00..3aa13bef79 100644 --- a/frappe/public/css/common.css +++ b/frappe/public/css/common.css @@ -89,6 +89,7 @@ kbd { } .dropdown-menu > li > a { padding: 14px; + white-space: normal; } .dropdown-menu { min-width: 200px; diff --git a/frappe/public/css/desk.css b/frappe/public/css/desk.css index ebe34f0de2..8ea2c5650f 100644 --- a/frappe/public/css/desk.css +++ b/frappe/public/css/desk.css @@ -89,6 +89,7 @@ kbd { } .dropdown-menu > li > a { padding: 14px; + white-space: normal; } .dropdown-menu { min-width: 200px; diff --git a/frappe/public/css/website.css b/frappe/public/css/website.css index a02316f7b9..9a92bccf38 100644 --- a/frappe/public/css/website.css +++ b/frappe/public/css/website.css @@ -89,6 +89,7 @@ kbd { } .dropdown-menu > li > a { padding: 14px; + white-space: normal; } .dropdown-menu { min-width: 200px; diff --git a/frappe/public/js/frappe/ui/toolbar/notifications.js b/frappe/public/js/frappe/ui/toolbar/notifications.js index 465edf02a0..00149224cd 100644 --- a/frappe/public/js/frappe/ui/toolbar/notifications.js +++ b/frappe/public/js/frappe/ui/toolbar/notifications.js @@ -24,7 +24,7 @@ frappe.ui.notifications = { this.boot_info = frappe.boot.notification_info; let defaults = ["Comment", "ToDo", "Event"]; - this.get_counts(this.boot_info.open_count_doctype, 0, defaults); + this.get_counts(this.boot_info.open_count_doctype, 1, defaults); this.get_counts(this.boot_info.open_count_other, 1); // Target counts are stored for docs per doctype @@ -49,16 +49,19 @@ frappe.ui.notifications = { }, get_counts: function(map, divide, keys, excluded = [], target = false) { + let empty_map = 1; keys = keys ? keys : Object.keys(map).sort().filter(e => !excluded.includes(e)); keys.map(key => { let doc_dt = (map.doctypes) ? map.doctypes[key] : undefined; - if(map[key] > 0) { + if(map[key] > 0 || target) { this.add_notification(key, map[key], doc_dt, target); + empty_map = 0; } }); - if(divide) + if(divide && !empty_map) { this.dropdown.append($('
  • ')); + } }, add_notification: function(name, value, doc_dt, target = false) { @@ -68,7 +71,7 @@ frappe.ui.notifications = { ${value} `) : $(`
  • ${label} + data-doc="${name}">${label}
    diff --git a/frappe/public/less/common.less b/frappe/public/less/common.less index 5c5238d30b..a97bc3f6dc 100644 --- a/frappe/public/less/common.less +++ b/frappe/public/less/common.less @@ -101,6 +101,7 @@ kbd { // dropdowns .dropdown-menu > li > a { padding: 14px; + white-space: normal; } .dropdown-menu {