From f69fc526c69ac7a01f432973533b47e77c1fcf71 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Mon, 26 Sep 2016 18:16:12 +0530 Subject: [PATCH] notification fix and date selectable (frappe/erpnext#6423) (frappe/erpnext#6389) (#2088) * [ui][fix] disable notification when 0 * [enhance] other month dates selectable --- frappe/public/js/frappe/form/control.js | 2 ++ frappe/public/js/frappe/ui/toolbar/notifications.js | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/frappe/public/js/frappe/form/control.js b/frappe/public/js/frappe/form/control.js index 460ed1d899..65d0a85559 100644 --- a/frappe/public/js/frappe/form/control.js +++ b/frappe/public/js/frappe/form/control.js @@ -605,6 +605,8 @@ frappe.ui.form.ControlDate = frappe.ui.form.ControlData.extend({ changeYear: true, changeMonth: true, yearRange: "-70Y:+10Y", + showOtherMonths: true, + selectOtherMonths: true }, make_input: function() { this._super(); diff --git a/frappe/public/js/frappe/ui/toolbar/notifications.js b/frappe/public/js/frappe/ui/toolbar/notifications.js index caac9a5bfe..4b319a234a 100644 --- a/frappe/public/js/frappe/ui/toolbar/notifications.js +++ b/frappe/public/js/frappe/ui/toolbar/notifications.js @@ -46,10 +46,11 @@ frappe.ui.notifications.update_notifications = function() { } }); - // switch colour on the navbar + // switch colour on the navbar and disable if no notifications $(".navbar-new-comments") .html(frappe.ui.notifications.total > 20 ? '20+' : frappe.ui.notifications.total) - .toggleClass("navbar-new-comments-true", frappe.ui.notifications.total ? true : false); + .toggleClass("navbar-new-comments-true", frappe.ui.notifications.total ? true : false) + .parent().toggleClass("disabled", frappe.ui.notifications.total ? false : true); }