From 7e2d4cc7392b12bc103b5553a77f6d7fecaae163 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Sat, 5 Oct 2013 10:33:51 -0400 Subject: [PATCH] fix syntax error --- web/app/assets/javascripts/sidebar.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/web/app/assets/javascripts/sidebar.js b/web/app/assets/javascripts/sidebar.js index fff299f1a..6abfc54cb 100644 --- a/web/app/assets/javascripts/sidebar.js +++ b/web/app/assets/javascripts/sidebar.js @@ -110,7 +110,7 @@ url: url, processData: false, success: function(response) { - + updateNotificationList(response); // set notification count @@ -148,7 +148,7 @@ // wire up "x" button to delete notification $notification.find('#img-delete-notification').click(deleteNotificationHandler); if (type === context.JK.MessageType.FRIEND_REQUEST) { - var $action_btn = .find('#btn-notification-action'); + var $action_btn = $notification.find('#btn-notification-action'); $action_btn.text('ACCEPT'); $action_btn.click(function() { acceptFriendRequest({ "friend_request_id": payload.friend_request_id, "notification_id": payload.notification_id }); @@ -230,12 +230,13 @@ $('div[layout=sidebar] div[user-id=' + val.id + '].sidebar-search-result').show(); // wire up button click handler if search result is not a friend or the current user + var $sidebar = $('div[layout=sidebar] div[user-id=' + val.id + ']'); if (!val.is_friend && val.id !== context.JK.currentUserId) { - $('div[layout=sidebar] div[user-id=' + val.id + ']').find('.btn-connect-friend').click(sendFriendRequest); + $sidebar.find('.btn-connect-friend').click(sendFriendRequest); } // hide the button if the search result is already a friend else { - $('div[layout=sidebar] div[user-id=' + val.id + ']').find('.btn-connect-friend').hide(); + $sidebar.find('.btn-connect-friend').hide(); } });