indexiatech / ember-forms

Smart, Intuitive forms for Ember.js styled with Bootstrap, Multi layouts and Validation support.
http://indexiatech.github.io/ember-forms
Apache License 2.0
218 stars 45 forks source link

Support for disabled em-text (solution provided) #95

Closed joshpfosi closed 9 years ago

joshpfosi commented 9 years ago

This extremely simple change would allow support for disabled em-text boxes. I was going to generate a pull request but I think it'd be easier to just add them yourself. If not, I'm happy to fork it and make the request! All that needs to be changed is addon/text.js to:

import Em from 'ember';
import FormGroupComponent from './group';
import ControlMixin from 'ember-idx-forms/mixins/control';

/*
Form Input

Syntax:
{{em-text property="property name" rows=4}}
 */
export default FormGroupComponent.extend({
  controlView: Em.TextArea.extend(ControlMixin, {
    attributeBindings: ['placeholder'],
    placeholder: Em.computed.alias('parentView.placeholder'),
    model: Em.computed.alias('parentView.model'),
    propertyName: Em.computed.alias('parentView.propertyName'),
    rows: Em.computed.alias('parentView.rows'), // ADDED A COMMA (duh)
    disabled: Em.computed.alias('parentView.disabled') // ADDED THIS LINE
  }),
  property: void 0,
  label: void 0,
  placeholder: void 0,
  rows: 4,
  disabled: void 0, // ADDED THIS LINE
  controlWrapper: (function() {
    if (this.get('form.form_layout') === 'horizontal') {
      return 'col-sm-10';
    }
    return null;
  }).property('form.form_layout')
});
asaf commented 9 years ago

Cool, I will add it myself thanks!

tolgaek commented 9 years ago

:+1:

spruce commented 9 years ago

Will add it asap to my repo: https://github.com/piceaTech/ember-rapid-forms

asaf commented 9 years ago

@joshpfosi merged, thanks.