Browse Source

[notif] fix alignment (#3734)

version-14
Prateeksha Singh 8 years ago
committed by Makarand Bauskar
parent
commit
d230021134
5 changed files with 11 additions and 4 deletions
  1. +1
    -0
      frappe/public/css/common.css
  2. +1
    -0
      frappe/public/css/desk.css
  3. +1
    -0
      frappe/public/css/website.css
  4. +7
    -4
      frappe/public/js/frappe/ui/toolbar/notifications.js
  5. +1
    -0
      frappe/public/less/common.less

+ 1
- 0
frappe/public/css/common.css View File

@@ -89,6 +89,7 @@ kbd {
}
.dropdown-menu > li > a {
padding: 14px;
white-space: normal;
}
.dropdown-menu {
min-width: 200px;


+ 1
- 0
frappe/public/css/desk.css View File

@@ -89,6 +89,7 @@ kbd {
}
.dropdown-menu > li > a {
padding: 14px;
white-space: normal;
}
.dropdown-menu {
min-width: 200px;


+ 1
- 0
frappe/public/css/website.css View File

@@ -89,6 +89,7 @@ kbd {
}
.dropdown-menu > li > a {
padding: 14px;
white-space: normal;
}
.dropdown-menu {
min-width: 200px;


+ 7
- 4
frappe/public/js/frappe/ui/toolbar/notifications.js View File

@@ -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($('<li class="divider"></li>'));
}
},

add_notification: function(name, value, doc_dt, target = false) {
@@ -68,7 +71,7 @@ frappe.ui.notifications = {
<span class="badge pull-right">${value}</span>
</a></li>`)
: $(`<li><a class="progress-small" data-doctype="${doc_dt}"
data-doc="${name}">${label}
data-doc="${name}"><span class="dropdown-item-label">${label}<span>
<div class="progress-chart"><div class="progress">
<div class="progress-bar" style="width: ${value}%"></div>
</div></div>


+ 1
- 0
frappe/public/less/common.less View File

@@ -101,6 +101,7 @@ kbd {
// dropdowns
.dropdown-menu > li > a {
padding: 14px;
white-space: normal;
}

.dropdown-menu {


Loading…
Cancel
Save