Close notifications dropdown on mobile after you click something

This commit is contained in:
Neil Lalonde 2013-10-07 16:11:37 -04:00
parent cf4666d363
commit 6713db7133
2 changed files with 11 additions and 1 deletions

View file

@ -9,7 +9,10 @@
Discourse.Route = Em.Route.extend({ Discourse.Route = Em.Route.extend({
/** /**
Called every time we enter a route on Discourse. NOT called every time we enter a route on Discourse.
Only called the FIRST time we enter a route.
So, when going from one topic to another, activate will only be called on the
TopicRoute for the first topic.
@method activate @method activate
**/ **/

View file

@ -113,6 +113,13 @@ Discourse.TopicRoute = Discourse.Route.extend({
}, },
setupController: function(controller, model) { setupController: function(controller, model) {
if (Discourse.Mobile.mobileView) {
// close the dropdowns on mobile
$('.d-dropdown').hide();
$('header ul.icons li').removeClass('active');
$('[data-toggle="dropdown"]').parent().removeClass('open');
}
controller.setProperties({ controller.setProperties({
model: model, model: model,
editingTopic: false editingTopic: false