Forked from azizpunjani/application.controller.js
Last active
September 26, 2017 15:25
-
-
Save manufitoussi/cfc3b5358a838df913046aeac1c2285e to your computer and use it in GitHub Desktop.
Form-fields
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle', | |
field1: { | |
label: 'mon texte', | |
value: 'Coucou!', | |
isDirty: true | |
}, | |
field2: { | |
label: 'mon number', | |
value: 22, | |
isDirty: false | |
}, | |
field3: { | |
label: 'ma date', | |
value: '2016-12-23', | |
isDirty: false | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
classNames: ['bellow'] | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
classNameBindings: [':form-field-content', 'withSide:with-side'], | |
isCustomField: Ember.computed('fieldType', { | |
get() { | |
return this.get('fieldType') === 'form-field-custom'; | |
} | |
}), | |
fieldTypeComponent: Ember.computed('fieldType', { | |
get() { | |
return 'form-field-' + this.get('fieldType'); | |
} | |
}), | |
withSide: false | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
tagName:'label' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
classNames: ['side'] | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
classNameBindings: [':form-field', 'isDirty:dirty:'], | |
isDirty: Ember.computed.reads('field.isDirty'), | |
label: Ember.computed.reads('field.label'), | |
fieldType: 'form-field-text' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
margin: 12px 16px; | |
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; | |
font-size: 12pt; | |
} | |
.form-field { | |
position: relative; | |
border: 1px solid #eee; | |
padding: 4px; | |
margin: 4px; | |
} | |
.form-field.dirty { | |
background-color: lightBlue; | |
} | |
.form-field:after { | |
display: block; | |
clear: both; | |
content: ''; | |
} | |
label { | |
font-weight: bold; | |
float: left; | |
width: 19% | |
} | |
.bellow { | |
float: left; | |
width: 100%; | |
} | |
.form-field-content { | |
width: 80%; | |
float: right; | |
} | |
.side { | |
float: right; | |
width: 19%; | |
} | |
.form-field-content input { | |
width: 100%; | |
} | |
.form-field-content .inner.with-side > .form-field-value { | |
float: left; | |
width: 80%; | |
} | |
.form-field-content .inner.with-side:after { | |
display: block; | |
clear: both; | |
content: ''; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.5.0", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.3.0", | |
"ember-template-compiler": "2.3.0" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment