Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
joshpfosi opened this issue Mar 20, 2015 · 4 comments
Closed

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

joshpfosi opened this issue Mar 20, 2015 · 4 comments

Comments

@joshpfosi
Copy link

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
Copy link
Contributor

asaf commented Apr 2, 2015

Cool, I will add it myself thanks!

@tolgaek
Copy link

tolgaek commented Apr 9, 2015

👍

@spruce
Copy link

spruce commented Apr 14, 2015

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

@asaf
Copy link
Contributor

asaf commented May 11, 2015

@joshpfosi merged, thanks.

@asaf asaf closed this as completed May 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants