mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 03:36:18 +08:00
FIX: FAQ wasn't loading sometimes
This commit is contained in:
@ -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) {
|
||||
|
@ -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);
|
||||
});
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user