[fix] desktop notifications

This commit is contained in:
Rushabh Mehta 2017-09-25 11:06:54 +05:30
parent cef8c6be38
commit adc7ad69cd
3 changed files with 26 additions and 3 deletions

View file

@ -212,8 +212,8 @@ $.extend(frappe.desktop, {
notifier.toggle(sum ? true : false);
var circle = notifier.find(".circle-text");
var text = sum || '';
if(text > 20) {
text = '20+';
if(text > 99) {
text = '99+';
}
if(circle.length) {

View file

@ -43,7 +43,7 @@ frappe.ui.notifications = {
// switch colour on the navbar and disable if no notifications
$(".navbar-new-comments")
.html(this.total > 20 ? '20+' : this.total)
.html(this.total > 99 ? '99+' : this.total)
.toggleClass("navbar-new-comments-true", this.total ? true : false)
.parent().toggleClass("disabled", this.total ? false : true);
},

View file

@ -0,0 +1,23 @@
/* eslint-disable */
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
QUnit.test("test: Web Page", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
// insert a new Web Page
() => frappe.tests.make('Web Page', [
// values to be set
{key: 'value'}
]),
() => {
assert.equal(cur_frm.doc.key, 'value');
},
() => done()
]);
});