0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-26 02:50:28 +01:00

Fix step component current objects

Dieser Commit ist enthalten in:
Angus McLeod 2017-10-19 10:17:36 +08:00
Ursprung dc1cbfbfe4
Commit b8e0291512
2 geänderte Dateien mit 14 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -1,6 +1,18 @@
import { observes } from 'ember-addons/ember-computed-decorators';
export default Ember.Component.extend({ export default Ember.Component.extend({
classNames: 'wizard-custom-step', classNames: 'wizard-custom-step',
currentField: null, currentField: null,
currentAction: null, currentAction: null,
disableId: Ember.computed.not('step.isNew') disableId: Ember.computed.not('step.isNew'),
@observes('step')
resetCurrentObjects() {
const fields = this.get('step.fields');
const actions = this.get('step.actions');
this.setProperties({
currentField: fields.length ? fields[0] : null,
currentAction: actions.length ? actions[0] : null
});
}
}); });

Datei anzeigen

@ -81,7 +81,7 @@
<div class="wizard-header small"> <div class="wizard-header small">
{{i18n 'admin.wizard.field.choices_preset.label'}} {{i18n 'admin.wizard.field.choices_preset.label'}}
</div> </div>
{{combo-box value=field.choices_preset content=presetChoices none='admin.wizard.field.choices_preset.none'}} {{combo-box value=field.choices_preset content=presetChoices none='admin.wizard.none'}}
<label>{{i18n 'admin.wizard.field.choices_preset.filter'}}</label> <label>{{i18n 'admin.wizard.field.choices_preset.filter'}}</label>
{{wizard-custom-input inputs=field.choices_filters}} {{wizard-custom-input inputs=field.choices_filters}}
</div> </div>