mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 07:11:34 +08:00
Custom Preview for Header Logo
This commit is contained in:
@ -5,7 +5,28 @@ import computed from 'ember-addons/ember-computed-decorators';
|
||||
|
||||
const Wizard = Ember.Object.extend({
|
||||
@computed('steps.length')
|
||||
totalSteps: length => length
|
||||
totalSteps: length => length,
|
||||
|
||||
// A bit clunky, but get the current colors from the appropriate step
|
||||
getCurrentColors() {
|
||||
const colorStep = this.get('steps').findProperty('id', 'colors');
|
||||
if (!colorStep) { return; }
|
||||
|
||||
const themeChoice = colorStep.get('fieldsById.theme_id');
|
||||
if (!themeChoice) { return; }
|
||||
|
||||
const themeId = themeChoice.get('value');
|
||||
if (!themeId) { return; }
|
||||
|
||||
const choices = themeChoice.get('choices');
|
||||
if (!choices) { return; }
|
||||
|
||||
const option = choices.findProperty('id', themeId);
|
||||
if (!option) { return; }
|
||||
|
||||
return option.data.colors;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
export function findWizard() {
|
||||
|
Reference in New Issue
Block a user