bigbluebutton-Github/bigbluebutton-html5/app/client/views/sharedTemplates.coffee

34 lines
947 B
CoffeeScript
Raw Normal View History

Template.makeButton.helpers
hasGotUnreadMail: (userId) ->
chats = getInSession('chats')
if chats isnt undefined
if userId is "all_chats"
2015-07-09 01:09:29 +08:00
for tabs in chats
if tabs.gotMail is true
return true
else if userId is "PUBLIC_CHAT"
2015-07-09 01:09:29 +08:00
for tabs in chats
if tabs.userId is userId and tabs.gotMail is true
return true
return false
getNumberOfUnreadMessages: (userId) ->
if userId is "all_chats"
return
else
chats = getInSession('chats')
if chats isnt undefined
for chat in chats
if chat.userId is userId and chat.gotMail
if chat.number > 9
return "9+"
else
return chat.number
return
getNotificationClass: (userId) ->
if userId is "all_chats"
return "unreadChat"
if userId is "PUBLIC_CHAT"
2015-07-19 09:33:02 +08:00
return "unreadChatNumber"