From b84c7e4efbc326427bc842b6cb516449121e42f2 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Tue, 27 Aug 2013 16:50:50 -0400 Subject: [PATCH] Store mobile flag in Discourse.Session instead of Discourse --- app/assets/javascripts/discourse.js | 2 +- app/assets/javascripts/discourse/ember/resolver.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse.js b/app/assets/javascripts/discourse.js index d45c22fa3a2..0e197733ea4 100644 --- a/app/assets/javascripts/discourse.js +++ b/app/assets/javascripts/discourse.js @@ -143,7 +143,7 @@ Discourse = Ember.Application.createWithMixins(Discourse.Ajax, { bootbox.animate(false); bootbox.backdrop(true); // clicking outside a bootbox modal closes it - this.set('mobile', $html.hasClass('mobile')); + Discourse.Session.currentProp('mobile', $html.hasClass('mobile')) setInterval(function(){ Discourse.Formatter.updateRelativeAge($('.relative-date')); diff --git a/app/assets/javascripts/discourse/ember/resolver.js b/app/assets/javascripts/discourse/ember/resolver.js index 50c4c1e7d5d..25d5a98737c 100644 --- a/app/assets/javascripts/discourse/ember/resolver.js +++ b/app/assets/javascripts/discourse/ember/resolver.js @@ -16,7 +16,7 @@ Discourse.Resolver = Ember.DefaultResolver.extend({ @returns {Template} the template (if found) **/ resolveTemplate: function(parsedName) { - if (Discourse.get('mobile')) { + if (Discourse.Session.currentProp('mobile')) { var mobileParsedName = this.parseName(parsedName.fullName.replace("template:", "template:mobile/")); var mobileTemplate = this.findTemplate(mobileParsedName); if (mobileTemplate) return mobileTemplate;