Explorar el Código

fix: Mute badges if count is zero

version-14
Suraj Shetty hace 4 años
padre
commit
5f75db4393
Se han modificado 1 ficheros con 4 adiciones y 6 borrados
  1. +4
    -6
      frappe/public/js/frappe/widgets/shortcut_widget.js

+ 4
- 6
frappe/public/js/frappe/widgets/shortcut_widget.js Ver fichero

@@ -78,7 +78,6 @@ export default class ShortcutWidget extends Widget {
}

set_count(count) {
if (!count) return;
const get_label = () => {
if (this.format) {
return this.format.replace(/{}/g, count);
@@ -90,11 +89,10 @@ export default class ShortcutWidget extends Widget {
const label = get_label();
const buttons = $(`<div class="small pill">${label}</div>`);
if (this.color) {
buttons.css("background-color", this.color);
buttons.css(
"color",
frappe.ui.color.get_contrast_color(this.color)
);
let bg_color = count ? this.color: '#EEEEEE';
let text_color = count ? frappe.ui.color.get_contrast_color(bg_color): '#8D99A6';
buttons.css("background-color", bg_color);
buttons.css("color", text_color);
}

buttons.appendTo(this.action_area);


Cargando…
Cancelar
Guardar