FIX: avatar selection wasn't properly pre-selected

This commit is contained in:
Régis Hanol 2015-06-22 16:22:15 +02:00
parent 5a77f62181
commit 0bfabed2d5

View File

@ -5,9 +5,12 @@ export default ModalBodyView.extend({
classNames: ['avatar-selector'],
title: I18n.t('user.change_avatar.title'),
// *HACK* used to select the proper radio button, cause {{action}}
// stops the default behavior
// *HACK* used to select the proper radio button, because {{action}} stops the default behavior
selectedChanged: function() {
Em.run.next(() => $('input:radio[name="avatar"]').val([this.get('controller.selected')]) );
}.observes('controller.selected')
Em.run.next(() => $('input:radio[name="avatar"]').val([this.get('controller.selected')]));
}.observes('controller.selected').on("didInsertElement"),
_focusSelectedButton: function() {
Em.run.next(() => $('input:radio[value="' + this.get('controller.selected') + '"]').focus());
}.on("didInsertElement")
});