Skip to content

Commit

Permalink
Replaces view selects with ember-xselect
Browse files Browse the repository at this point in the history
  • Loading branch information
gschorkopf committed Aug 18, 2016
1 parent 20cca9b commit e454772
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/rounds/new.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var RoundsNewController = Ember.Controller.extend({

createRound: function() {
var _this = this;
this.set('model.course', this.get('model.course.content'));

this.get('model').save().then(function(round) {
_this.controllerFor('application').set('currentRound', round);
_this.controllerFor('application').set('currentHole', '1');
Expand Down
6 changes: 5 additions & 1 deletion app/templates/courses/new.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
<label for="state">
* State
</label>
{{view "select" content=stateAbbreviations value=model.state required=true classNames="form-control"}}
{{#x-select value=model.state required=true id='state' classNames='form-control'}}
{{#each stateAbbreviations as |state|}}
{{#x-option value=state}}{{state}}{{/x-option}}
{{/each}}
{{/x-select}}
</div>
<div class="form-group">
<label for="holeCount">
Expand Down
7 changes: 6 additions & 1 deletion app/templates/rounds/new.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@
<label for="course">
* Course
</label>
{{view "select" content=courses selection=model.course.content optionValuePath="content.id" optionLabelPath="content.name" prompt="Select Course" id="course" required=true classNames="form-control"}}
{{#x-select value=model.course required=true id='course' classNames='form-control'}}
<option></option>
{{#each courses as |course|}}
{{#x-option value=course}}{{course.name}}{{/x-option}}
{{/each}}
{{/x-select}}
</div>
<p>
Can't see the course you're looking for? Why not
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"ember-data": "1.13.15",
"ember-disable-proxy-controllers": "^1.0.1",
"ember-export-application-global": "^1.0.4",
"emberx-select": "2.2.1",
"express": "^4.8.5",
"glob": "^4.0.5"
}
Expand Down
1 change: 1 addition & 0 deletions tests/.jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"exists",
"fillIn",
"click",
"select",
"keyEvent",
"triggerEvent",
"find",
Expand Down
2 changes: 2 additions & 0 deletions tests/test-helper.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import resolver from './helpers/resolver';
import registerSelectHelper from './helpers/register-select-helper';
registerSelectHelper();
import {
setResolver
} from 'ember-qunit';
Expand Down

0 comments on commit e454772

Please sign in to comment.