FIX: display custom sections with default theme

also cleans up mechanism for previewing themes, cleans up naming,
gets rid of old janky "preview_style", secures local theme key
This commit is contained in:
Sam
2017-04-14 13:35:12 -04:00
parent 8370b4b1b7
commit def7348777
14 changed files with 113 additions and 50 deletions

View File

@@ -81,7 +81,7 @@ export default Ember.Controller.extend({
});
},
previewUrl: url('model.key', '/?preview-style=%@'),
previewUrl: url('model.id', '/admin/themes/%@/preview'),
maximizeIcon: function() {
return this.get('maximized') ? 'compress' : 'expand';
@@ -95,9 +95,6 @@ export default Ember.Controller.extend({
return !this.get('model.changed') || this.get('model.isSaving');
}.property('model.changed', 'model.isSaving'),
undoPreviewUrl: url('/?preview-style='),
defaultStyleUrl: url('/?preview-style=default'),
actions: {
save() {
this.get('model').saveChanges("theme_fields");

View File

@@ -25,6 +25,8 @@ export default Ember.Controller.extend({
return descriptions.reject(d=>Em.isBlank(d));
},
previewUrl: url('model.id', '/admin/themes/%@/preview'),
@computed("colorSchemeId", "model.color_scheme_id")
colorSchemeChanged(colorSchemeId, existingId) {
colorSchemeId = colorSchemeId === null ? null : parseInt(colorSchemeId);