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)
|
// If we have URL_FIXTURES, load from there instead (testing)
|
||||||
var fixture = Discourse.URL_FIXTURES && Discourse.URL_FIXTURES[url];
|
var fixture = Discourse.URL_FIXTURES && Discourse.URL_FIXTURES[url];
|
||||||
if (fixture) {
|
if (fixture) {
|
||||||
return Ember.Deferred.promise(function(promise) {
|
return Ember.RSVP.resolve(fixture);
|
||||||
promise.resolve(fixture);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Ember.Deferred.promise(function (promise) {
|
return Ember.Deferred.promise(function (promise) {
|
||||||
|
@ -20,7 +20,7 @@ Discourse.StaticController = Discourse.Controller.extend({
|
|||||||
text = text[1];
|
text = text[1];
|
||||||
this.set('content', text);
|
this.set('content', text);
|
||||||
} else {
|
} else {
|
||||||
return Discourse.ajax(path).then(function (result) {
|
return Discourse.ajax(path, {dataType: 'html'}).then(function (result) {
|
||||||
staticController.set('content', result);
|
staticController.set('content', result);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -9,9 +9,11 @@
|
|||||||
Discourse.StaticController.pages.forEach(function(page) {
|
Discourse.StaticController.pages.forEach(function(page) {
|
||||||
|
|
||||||
Discourse[(page.capitalize()) + "Route"] = Discourse.Route.extend({
|
Discourse[(page.capitalize()) + "Route"] = Discourse.Route.extend({
|
||||||
|
|
||||||
renderTemplate: function() {
|
renderTemplate: function() {
|
||||||
this.render('static');
|
this.render('static');
|
||||||
},
|
},
|
||||||
|
|
||||||
setupController: function() {
|
setupController: function() {
|
||||||
var config_key = Discourse.StaticController.configs[page];
|
var config_key = Discourse.StaticController.configs[page];
|
||||||
if (config_key && Discourse.SiteSettings[config_key].length > 0) {
|
if (config_key && Discourse.SiteSettings[config_key].length > 0) {
|
||||||
@ -20,6 +22,7 @@ Discourse.StaticController.pages.forEach(function(page) {
|
|||||||
this.controllerFor('static').loadPath("/" + page);
|
this.controllerFor('static').loadPath("/" + page);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user