From db6705e0755b9789c5cd0eaebdc6c2da27595c22 Mon Sep 17 00:00:00 2001 From: Daniel Pan Date: Thu, 23 Apr 2015 16:16:43 +0800 Subject: [PATCH] Hide group nav popup when click a group --- static/scripts/app/views/top-group-nav.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/static/scripts/app/views/top-group-nav.js b/static/scripts/app/views/top-group-nav.js index 4ab726b7d6..1ec86b9632 100644 --- a/static/scripts/app/views/top-group-nav.js +++ b/static/scripts/app/views/top-group-nav.js @@ -12,7 +12,7 @@ define([ popupTemplate: _.template($('#top-group-nav-tmpl').html()), initialize: function() { - var popup = $(this.popupTemplate({groups: app.pageOptions.top_nav_groups})); + var popup = $(this.popupTemplate({groups: app.pageOptions.top_nav_groups})); this.$el.append(popup); popup.css({'right': ($('#top-nav-grp').outerWidth() - popup.outerWidth())/6 * 5}); this.popup = popup; @@ -26,7 +26,7 @@ define([ 'click #top-nav-grp-list .item': 'visitGroup' }, - showPopup: function() { + showPopup: function(e) { this.popup.removeClass('hide'); }, @@ -43,6 +43,7 @@ define([ }, visitGroup: function(e) { + this.hidePopup(e); location.href = $(e.currentTarget).attr('data-url'); } });