Store mobile flag in Discourse.Session instead of Discourse

This commit is contained in:
Neil Lalonde 2013-08-27 16:50:50 -04:00
parent 3cfc9a7bba
commit b84c7e4efb
2 changed files with 2 additions and 2 deletions

View File

@ -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'));

View File

@ -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;