From 08c8edb87f8669fd77318dbf89364adff076299e Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 1 Mar 2012 14:53:05 +0530 Subject: [PATCH] fix in desktop and notifications --- erpnext/home/page/desktop/desktop.css | 7 ++-- erpnext/startup/startup.js | 41 +++++++++++-------- .../Purchase Order-Purchase Receipt.txt | 4 +- erpnext/utilities/page/messages/messages.js | 1 + js/all-app.js | 6 +-- js/all-web.js | 6 +-- version.num | 2 +- 7 files changed, 37 insertions(+), 30 deletions(-) diff --git a/erpnext/home/page/desktop/desktop.css b/erpnext/home/page/desktop/desktop.css index 836469c14e..e460c11607 100644 --- a/erpnext/home/page/desktop/desktop.css +++ b/erpnext/home/page/desktop/desktop.css @@ -85,10 +85,11 @@ } .circle { - border-radius: 100%; - -moz-border-radius: 100%; - -webkit-border-radius: 100%; + border-radius: 30px; + -moz-border-radius: 30px; + -webkit-border-radius: 30px; height: 15px; + line-height: 12px; min-width: 15px; background: #B00D07; padding: 3px; diff --git a/erpnext/startup/startup.js b/erpnext/startup/startup.js index 568714561d..6448574917 100644 --- a/erpnext/startup/startup.js +++ b/erpnext/startup/startup.js @@ -103,30 +103,35 @@ show_chart_browser = function(nm, chart_type){ // ========== Update Messages ============ -var update_messages = function() { +var update_messages = function(reset) { // Updates Team Messages if(inList(['Guest'], user)) { return; } - - $c_page('home', 'event_updates', 'get_unread_messages', null, - function(r,rt) { - if(!r.exc) { - // This function is defined in toolbar.js - page_body.wntoolbar.set_new_comments(r.message); - var circle = $('#msg_count') - if(circle) { - if(r.message.length) { - circle.find('span:first').text(r.message.length); - circle.toggle(true); - } else { - circle.toggle(false); + + if(!reset) { + $c_page('home', 'event_updates', 'get_unread_messages', null, + function(r,rt) { + if(!r.exc) { + // This function is defined in toolbar.js + page_body.wntoolbar.set_new_comments(r.message); + var circle = $('#msg_count') + if(circle) { + if(r.message.length) { + circle.find('span:first').text(r.message.length); + circle.toggle(true); + } else { + circle.toggle(false); + } } + } else { + clearInterval(wn.updates.id); } - } else { - clearInterval(wn.updates.id); } - } - ); + ); + } else { + page_body.wntoolbar.set_new_comments(0); + $('#msg_count').toggle(false); + } } erpnext.startup.set_periodic_updates = function() { diff --git a/erpnext/stock/DocType Mapper/Purchase Order-Purchase Receipt/Purchase Order-Purchase Receipt.txt b/erpnext/stock/DocType Mapper/Purchase Order-Purchase Receipt/Purchase Order-Purchase Receipt.txt index 73dfd4b6a9..c7e15575a5 100644 --- a/erpnext/stock/DocType Mapper/Purchase Order-Purchase Receipt/Purchase Order-Purchase Receipt.txt +++ b/erpnext/stock/DocType Mapper/Purchase Order-Purchase Receipt/Purchase Order-Purchase Receipt.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2010-08-08 17:09:35', + 'creation': '2010-09-20 12:33:34', 'docstatus': 0, - 'modified': '2012-02-29 17:55:13', + 'modified': '2012-03-01 14:01:03', 'modified_by': u'Administrator', 'owner': u'Administrator' }, diff --git a/erpnext/utilities/page/messages/messages.js b/erpnext/utilities/page/messages/messages.js index f33c47b99d..6937796168 100644 --- a/erpnext/utilities/page/messages/messages.js +++ b/erpnext/utilities/page/messages/messages.js @@ -19,6 +19,7 @@ wn.provide('erpnext.messages'); wn.pages.messages.onload = function(wrapper) { erpnext.messages.show_active_users(); erpnext.messages.make_list(); + update_messages('reset'); //Resets notification icons // post message $('#message-post').click(function() { diff --git a/js/all-app.js b/js/all-app.js index d56b23b06f..832923c2f1 100644 --- a/js/all-app.js +++ b/js/all-app.js @@ -2242,9 +2242,9 @@ show_chart_browser=function(nm,chart_type){var call_back=function(){if(nm=='Sale else if(nm=='Accounts Browser') pscript.make_chart(chart_type);} loadpage(nm,call_back);} -var update_messages=function(){if(inList(['Guest'],user)){return;} -$c_page('home','event_updates','get_unread_messages',null,function(r,rt){if(!r.exc){page_body.wntoolbar.set_new_comments(r.message);var circle=$('#msg_count') -if(circle){if(r.message.length){circle.find('span:first').text(r.message.length);circle.toggle(true);}else{circle.toggle(false);}}}else{clearInterval(wn.updates.id);}});} +var update_messages=function(reset){if(inList(['Guest'],user)){return;} +if(!reset){$c_page('home','event_updates','get_unread_messages',null,function(r,rt){if(!r.exc){page_body.wntoolbar.set_new_comments(r.message);var circle=$('#msg_count') +if(circle){if(r.message.length){circle.find('span:first').text(r.message.length);circle.toggle(true);}else{circle.toggle(false);}}}else{clearInterval(wn.updates.id);}});}else{page_body.wntoolbar.set_new_comments(0);$('#msg_count').toggle(false);}} erpnext.startup.set_periodic_updates=function(){wn.updates={};if(wn.updates.id){clearInterval(wn.updates.id);} wn.updates.id=setInterval(update_messages,60000);} erpnext.set_user_background=function(src){set_style(repl('body { background: url("files/%(src)s") repeat !important;}',{src:src}))} diff --git a/js/all-web.js b/js/all-web.js index b98ae580f6..08e84bf916 100644 --- a/js/all-web.js +++ b/js/all-web.js @@ -1090,9 +1090,9 @@ show_chart_browser=function(nm,chart_type){var call_back=function(){if(nm=='Sale else if(nm=='Accounts Browser') pscript.make_chart(chart_type);} loadpage(nm,call_back);} -var update_messages=function(){if(inList(['Guest'],user)){return;} -$c_page('home','event_updates','get_unread_messages',null,function(r,rt){if(!r.exc){page_body.wntoolbar.set_new_comments(r.message);var circle=$('#msg_count') -if(circle){if(r.message.length){circle.find('span:first').text(r.message.length);circle.toggle(true);}else{circle.toggle(false);}}}else{clearInterval(wn.updates.id);}});} +var update_messages=function(reset){if(inList(['Guest'],user)){return;} +if(!reset){$c_page('home','event_updates','get_unread_messages',null,function(r,rt){if(!r.exc){page_body.wntoolbar.set_new_comments(r.message);var circle=$('#msg_count') +if(circle){if(r.message.length){circle.find('span:first').text(r.message.length);circle.toggle(true);}else{circle.toggle(false);}}}else{clearInterval(wn.updates.id);}});}else{page_body.wntoolbar.set_new_comments(0);$('#msg_count').toggle(false);}} erpnext.startup.set_periodic_updates=function(){wn.updates={};if(wn.updates.id){clearInterval(wn.updates.id);} wn.updates.id=setInterval(update_messages,60000);} erpnext.set_user_background=function(src){set_style(repl('body { background: url("files/%(src)s") repeat !important;}',{src:src}))} diff --git a/version.num b/version.num index 3aedf24eb3..e1233a6405 100644 --- a/version.num +++ b/version.num @@ -1 +1 @@ -784 +787 \ No newline at end of file