FIX: CSS Customizations were showing as undefined
This commit is contained in:
parent
de76b512c1
commit
d37ed80e8a
|
@ -9,11 +9,6 @@
|
|||
Discourse.SiteCustomization = Discourse.Model.extend({
|
||||
trackedProperties: ['enabled', 'name', 'stylesheet', 'header', 'mobile_stylesheet', 'mobile_header', 'override_default_style'],
|
||||
|
||||
init: function() {
|
||||
this._super();
|
||||
this.startTrackingChanges();
|
||||
},
|
||||
|
||||
description: function() {
|
||||
return "" + this.name + (this.enabled ? ' (*)' : '');
|
||||
}.property('selected', 'name'),
|
||||
|
@ -43,7 +38,7 @@ Discourse.SiteCustomization = Discourse.Model.extend({
|
|||
return true;
|
||||
});
|
||||
this.set('originals', originals);
|
||||
},
|
||||
}.on('init'),
|
||||
|
||||
previewUrl: function() {
|
||||
return "/?preview-style=" + (this.get('key'));
|
||||
|
@ -103,15 +98,14 @@ var SiteCustomizations = Ember.ArrayProxy.extend({
|
|||
|
||||
Discourse.SiteCustomization.reopenClass({
|
||||
findAll: function() {
|
||||
var customizations = SiteCustomizations.create({ content: [], loading: true });
|
||||
Discourse.ajax("/admin/site_customizations").then(function (data) {
|
||||
return Discourse.ajax("/admin/site_customizations").then(function (data) {
|
||||
var content = [];
|
||||
if (data) {
|
||||
_.each(data.site_customizations,function(c) {
|
||||
customizations.pushObject(Discourse.SiteCustomization.create(c.site_customizations));
|
||||
content = data.site_customizations.map(function(c) {
|
||||
return Discourse.SiteCustomization.create(c);
|
||||
});
|
||||
}
|
||||
customizations.set('loading', false);
|
||||
return SiteCustomizations.create({ content: content });
|
||||
});
|
||||
return customizations;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,15 +1,5 @@
|
|||
/**
|
||||
Handles routes related to css/html customization
|
||||
|
||||
@class AdminCustomizeCssHtmlRoute
|
||||
@extends Discourse.Route
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.AdminCustomizeCssHtmlRoute = Discourse.Route.extend({
|
||||
|
||||
model: function() {
|
||||
return Discourse.SiteCustomization.findAll();
|
||||
}
|
||||
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue