mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
FIX: FAQ wasn't loading sometimes
This commit is contained in:
parent
1927263d1d
commit
82c734ec84
3 changed files with 5 additions and 4 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue