Skip to content
Permalink
Browse files

translated back to vanilla Ember

  • Loading branch information...
jeffreybiles committed Jul 4, 2015
1 parent a7c3051 commit d7b22ae8e2fc80a64d9698aff40a339e148db777
Showing with 13 additions and 8 deletions.
  1. +7 −2 ember_admin/app/tag/edit-fields/component.js
  2. +6 −6 ember_admin/app/tag/edit-fields/template.hbs
@@ -4,8 +4,13 @@ export default Ember.Component.extend({
tagTypes: ['series', 'subject'],

actions: {
selectTagType(value, component) {
this.set('model.tagType', value);
selectTagType() {
const selectedEl = this.$('#tag-type-select')[0];
const selectedIndex = selectedEl.selectedIndex;
const options = $('#tag-type-select option');
const selectedValue = options[selectedIndex].value;

this.set('model.tagType', selectedValue);
}
}
});
@@ -1,15 +1,15 @@
<div>Name: {{input value=model.name}}</div>
<div>Description: {{textarea value=model.description}}</div>
<div>Tag Type:
{{#x-select action='selectTagType' id="tag-type-select" value=model.tagType}}
{{#x-option}}Prompt: select something{{/x-option}}
<select {{action 'selectTagType' on='change'}} id="tag-type-select">
<option>Prompt: select something</option>
{{#each tagTypes as |type|}}
{{#x-option value=type}}{{type}}{{/x-option}}
<option value="{{type}}" selected={{eq type model.tagType}}>{{type}}</option>
{{/each}}
{{#each model.awesomeOptions as |type|}}
{{#x-option value=type}}{{type}}{{/x-option}}
<option value="{{type}}" selected={{eq type model.tagType}}>{{type}}</option>
{{/each}}
{{#x-option value="ninja"}}Just a normal person, promise{{/x-option}}
{{/x-select}}
<option value="{{ninja}}">Just a normal person, promise</option>
</select>
</div>
<div>Priority: {{input value=model.priority}}</div>

0 comments on commit d7b22ae

Please sign in to comment.
You can’t perform that action at this time.