websocket js handler should know about different notification types
This commit is contained in:
parent
d448436376
commit
ead1f80b08
1 changed files with 3 additions and 2 deletions
|
|
@ -16,7 +16,8 @@ var WebSocketReceiver = {
|
|||
|
||||
onMessage: function(evt) {
|
||||
var obj = jQuery.parseJSON(evt.data);
|
||||
if(obj['class'] == 'notifications') {
|
||||
|
||||
if(obj['class'].match(/^notifications/)) {
|
||||
WebSocketReceiver.processNotification(obj);
|
||||
} else if (obj['class'] == 'people') {
|
||||
WSR.debug("got a " + obj['class']);
|
||||
|
|
@ -60,7 +61,7 @@ var WebSocketReceiver = {
|
|||
|
||||
|
||||
processNotification: function(notification){
|
||||
var nBadge = $("#notification_badge_number");
|
||||
var nBadge = $("#notification_badge div.badge_count");
|
||||
|
||||
nBadge.html().replace(/\d+/, function(num){
|
||||
nBadge.html(parseInt(num)+1);
|
||||
|
|
|
|||
Loading…
Reference in a new issue