Store mobile flag in Discourse.Session instead of Discourse
This commit is contained in:
parent
3cfc9a7bba
commit
b84c7e4efb
|
@ -143,7 +143,7 @@ Discourse = Ember.Application.createWithMixins(Discourse.Ajax, {
|
||||||
bootbox.animate(false);
|
bootbox.animate(false);
|
||||||
bootbox.backdrop(true); // clicking outside a bootbox modal closes it
|
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(){
|
setInterval(function(){
|
||||||
Discourse.Formatter.updateRelativeAge($('.relative-date'));
|
Discourse.Formatter.updateRelativeAge($('.relative-date'));
|
||||||
|
|
|
@ -16,7 +16,7 @@ Discourse.Resolver = Ember.DefaultResolver.extend({
|
||||||
@returns {Template} the template (if found)
|
@returns {Template} the template (if found)
|
||||||
**/
|
**/
|
||||||
resolveTemplate: function(parsedName) {
|
resolveTemplate: function(parsedName) {
|
||||||
if (Discourse.get('mobile')) {
|
if (Discourse.Session.currentProp('mobile')) {
|
||||||
var mobileParsedName = this.parseName(parsedName.fullName.replace("template:", "template:mobile/"));
|
var mobileParsedName = this.parseName(parsedName.fullName.replace("template:", "template:mobile/"));
|
||||||
var mobileTemplate = this.findTemplate(mobileParsedName);
|
var mobileTemplate = this.findTemplate(mobileParsedName);
|
||||||
if (mobileTemplate) return mobileTemplate;
|
if (mobileTemplate) return mobileTemplate;
|
||||||
|
|
Loading…
Reference in New Issue