From 0f70fe2eb22c7909c05809d2b31eea96c0dd4262 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Thu, 3 Oct 2013 08:09:31 -0400 Subject: [PATCH 1/2] VRFS-755 fix issue with undefined session invitations --- web/app/assets/javascripts/findSession.js | 27 ++++++++++++++--------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/web/app/assets/javascripts/findSession.js b/web/app/assets/javascripts/findSession.js index 6f44cb4b2..9032f24e7 100644 --- a/web/app/assets/javascripts/findSession.js +++ b/web/app/assets/javascripts/findSession.js @@ -175,12 +175,15 @@ function containsInvitation(session) { var i, invitation = null; - // user has invitations for this session - for (i=0; i < session.invitations.length; i++) { - invitation = session.invitations[i]; - // session contains an invitation for this user - if (invitation.receiver_id == context.JK.currentUserId) { - return true; + + if (invitations in session) { + // user has invitations for this session + for (i=0; i < session.invitations.length; i++) { + invitation = session.invitations[i]; + // session contains an invitation for this user + if (invitation.receiver_id == context.JK.currentUserId) { + return true; + } } } @@ -190,11 +193,13 @@ function containsFriend(session) { var i, participant = null; - for (i=0; i < session.participants.length; i++) { - participant = session.participants[i]; - // this session participant is a friend - if (participant !== null && participant !== undefined && participant.user.is_friend) { - return true; + if (participants in session) { + for (i=0; i < session.participants.length; i++) { + participant = session.participants[i]; + // this session participant is a friend + if (participant !== null && participant !== undefined && participant.user.is_friend) { + return true; + } } } return false; From 6192a1f20c6a14a7dbb0821a2083fa855f33d37a Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Thu, 3 Oct 2013 08:51:25 -0400 Subject: [PATCH 2/2] VRFS-595 fix format of session invitation notification --- web/app/assets/javascripts/sidebar.js | 5 ++++- web/app/assets/stylesheets/client/sidebar.css.scss | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/web/app/assets/javascripts/sidebar.js b/web/app/assets/javascripts/sidebar.js index 758235423..589b43dae 100644 --- a/web/app/assets/javascripts/sidebar.js +++ b/web/app/assets/javascripts/sidebar.js @@ -538,11 +538,14 @@ }).error(app.ajaxError); var participantHtml = "You have been invited to join a session with:

"; + participantHtml += ""; $.each(participants, function(index, val) { - participantHtml += " " + val.name + "
"; + participantHtml += ""; }); + participantHtml += "
" + val.name + "
"; + // display notification app.notify({ "title": "Session Invitation", diff --git a/web/app/assets/stylesheets/client/sidebar.css.scss b/web/app/assets/stylesheets/client/sidebar.css.scss index e31530fbc..2d42dcdec 100644 --- a/web/app/assets/stylesheets/client/sidebar.css.scss +++ b/web/app/assets/stylesheets/client/sidebar.css.scss @@ -98,7 +98,7 @@ ms-filter: "alpha(opacity=50)"; } - li .avatar-small { + .avatar-small { float:left; padding:1px; width:36px; @@ -110,7 +110,7 @@ border-radius:18px; } - li .avatar-small img { + .avatar-small img { width: 36px; height: 36px; -webkit-border-radius:18px;