Skip to content

Commit

Permalink
Allow disabling input fields via input helper
Browse files Browse the repository at this point in the history
  • Loading branch information
dschmidt committed May 22, 2014
1 parent 5b4aaed commit 0ab39d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/ember-easyForm/lib/views/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Ember.EasyForm.Input = Ember.EasyForm.BaseView.extend({
},
concatenatedProperties: ['inputOptions', 'bindableInputOptions'],
inputOptions: ['as', 'collection', 'optionValuePath', 'optionLabelPath', 'selection', 'value', 'multiple', 'name'],
bindableInputOptions: ['placeholder', 'prompt'],
bindableInputOptions: ['placeholder', 'prompt', 'disabled'],
defaultOptions: {
name: function(){
if (this.property) {
Expand Down
3 changes: 2 additions & 1 deletion packages/ember-easyForm/tests/helpers/input_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,14 +251,15 @@ test('block form for input without label', function() {

test('sets input attributes property', function() {
view = Ember.View.create({
template: templateFor('{{input receiveAt as="email" placeholder="Your email"}}'),
template: templateFor('{{input receiveAt as="email" placeholder="Your email" disabled=true}}'),
container: container,
controller: controller
});
append(view);
var input = view.$().find('input');
equal(input.prop('type'), 'email');
equal(input.prop('placeholder'), 'Your email');
equal(input.prop('disabled'), true);
});

test('binds label to input field', function() {
Expand Down

0 comments on commit 0ab39d2

Please sign in to comment.