FIX: FAQ wasn't loading sometimes

This commit is contained in:
Robin Ward 2013-07-16 12:11:30 -04:00
parent 1927263d1d
commit 82c734ec84
3 changed files with 5 additions and 4 deletions

View file

@ -250,9 +250,7 @@ Discourse = Ember.Application.createWithMixins({
// If we have URL_FIXTURES, load from there instead (testing)
var fixture = Discourse.URL_FIXTURES && Discourse.URL_FIXTURES[url];
if (fixture) {
return Ember.Deferred.promise(function(promise) {
promise.resolve(fixture);
});
return Ember.RSVP.resolve(fixture);
}
return Ember.Deferred.promise(function (promise) {

View file

@ -20,7 +20,7 @@ Discourse.StaticController = Discourse.Controller.extend({
text = text[1];
this.set('content', text);
} else {
return Discourse.ajax(path).then(function (result) {
return Discourse.ajax(path, {dataType: 'html'}).then(function (result) {
staticController.set('content', result);
});
}

View file

@ -9,9 +9,11 @@
Discourse.StaticController.pages.forEach(function(page) {
Discourse[(page.capitalize()) + "Route"] = Discourse.Route.extend({
renderTemplate: function() {
this.render('static');
},
setupController: function() {
var config_key = Discourse.StaticController.configs[page];
if (config_key && Discourse.SiteSettings[config_key].length > 0) {
@ -20,6 +22,7 @@ Discourse.StaticController.pages.forEach(function(page) {
this.controllerFor('static').loadPath("/" + page);
}
}
});
});