From 55c46d1bb643fd7f6affdea71894dc51a82c9b7d Mon Sep 17 00:00:00 2001 From: lilia Date: Thu, 19 Feb 2015 11:48:56 -0800 Subject: [PATCH] Close conversation menu when clicking outside it --- js/views/conversation_view.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/js/views/conversation_view.js b/js/views/conversation_view.js index 83e9505e..b24a179a 100644 --- a/js/views/conversation_view.js +++ b/js/views/conversation_view.js @@ -52,7 +52,14 @@ 'click .end-session': 'endSession', 'click .leave-group': 'leaveGroup', 'click .new-group-update': 'newGroupUpdate', - 'click .hamburger': 'toggleMenu' + 'click .hamburger': 'toggleMenu', + 'click' : 'closeMenu' + }, + + closeMenu: function(e) { + if (e && !$(e.target).hasClass('hamburger')) { + this.$el.find('.menu-list').hide(); + } }, endSession: function() {