-
-
Save johan--/2653eceaaa46095225c8 to your computer and use it in GitHub Desktop.
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
Ember.GroupedSelect = Ember.Select.extend({ | |
classNames: ['ember-grouped-select'], | |
defaultTemplate: Ember.Handlebars.compile('{{#if view.prompt}}<option value>{{view.prompt}}</option>{{/if}}{{#each view.groupedContent}}{{view Ember.SelectOptGroup labelBinding="label" contentBinding="content"}}{{/each}}'), | |
}); | |
Ember.SelectOptGroup = Ember.View.extend({ | |
tagName: 'optgroup', | |
classNames: [], | |
attributeBindings: ['label'], | |
defaultTemplate: Ember.Handlebars.compile('{{#each this.content}}{{view Ember.SelectOption contentBinding="this"}}{{/each}}'), | |
// proxy to the Select | |
optionLabelPath: function() { | |
return Ember.getPath(this, 'parentView.optionLabelPath'); | |
}.property('parentView.optionLabelPath'), | |
optionValuePath: function() { | |
return Ember.getPath(this, 'parentView.optionValuePath'); | |
}.property('parentView.optionValuePath'), | |
selection: function() { | |
return Ember.getPath(this, 'parentView.selection'); | |
}.property('parentView.selection'), | |
multiple: function() { | |
return Ember.getPath(this, 'parentView.multiple'); | |
}.property('parentView.multiple') | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment