Last active
August 29, 2015 14:27
-
-
Save rondale-sc/2f23f9c3f66ba0d21ebd to your computer and use it in GitHub Desktop.
This file contains hidden or 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'; | |
| const genericSelectOptPath = function([opt, path]) { | |
| if (path) { | |
| return opt.get(path); | |
| } else { | |
| return opt; | |
| } | |
| }; | |
| export { genericSelectOptPath }; | |
| export default Ember.HTMLBars.makeBoundHelper(genericSelectOptPath); |
This file contains hidden or 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"; | |
| import { genericSelectOptPath } from 'frontend/helpers/generic-select-opt-path'; | |
| export default Ember.Component.extend({ | |
| didInsertElement: function() { | |
| if (!this.get('value')) { | |
| return this.set('value', genericSelectOptPath([this.get('options.firstObject'), this.get('optValuePath')])); | |
| } | |
| }, | |
| actions: { | |
| updateValue: function(e) { | |
| return this.set('value', Ember.$(e.target).val()); | |
| } | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment