-
-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bump ember dependency for parentView bugfix.
In order to fetch the parentView for an element reliably, we depend on a bugfix that only came available in Ember v1.13.4 emberjs/ember.js#11266 This also adds a test case that was breaking in 1.13.{0-3} resolves #44
- Loading branch information
Showing
6 changed files
with
103 additions
and
2 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/*global expect */ | ||
/* jshint expr:true */ | ||
|
||
import Ember from 'ember'; | ||
import startApp from '../helpers/start-app'; | ||
import { it } from 'ember-mocha'; | ||
import { beforeEach, afterEach, describe } from '../test-helper'; | ||
|
||
|
||
var App; | ||
|
||
describe('XSelect: Embedded HTML', function() { | ||
beforeEach(function() { | ||
App = startApp(); | ||
visit("/zany-embedded-html"); | ||
}); | ||
beforeEach(function() { | ||
var el = Ember.$('select'); | ||
this.component = getComponentById(el.attr('id')); | ||
this.$ = function() { | ||
return this.component.$.apply(this.component, arguments); | ||
}; | ||
this.controller = App.__container__.lookup('controller:zanyEmbeddedHTML'); | ||
}); | ||
|
||
it("renders", function() { | ||
expect(this.$()).to.exist; | ||
}); | ||
|
||
afterEach(function() { | ||
Ember.run(App, 'destroy'); | ||
}); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import Ember from 'ember'; | ||
|
||
/** | ||
* This controller sets up things a bit weirdly, because we're trying | ||
* to trigger this bug in ember: | ||
* https://github.com/emberjs/ember.js/pull/11266/files | ||
* | ||
* After initialization, it atumotically triggers a re-render by | ||
* updating the groups to be rendered. This will fail on ember | ||
* 1.13.{0,3}. | ||
* | ||
* It was initially reported as: | ||
* | ||
* https://github.com/thefrontside/emberx-select/issues/44 | ||
*/ | ||
|
||
export default Ember.Controller.extend({ | ||
groupsOfZanyThings: [], | ||
|
||
|
||
schedulePopulate: Ember.on('init', function() { | ||
Ember.run.schedule('afterRender', this, 'populate'); | ||
}), | ||
|
||
populate: function() { | ||
this.set('groupsOfZanyThings', Ember.A([ | ||
{ | ||
label: 'Sandwiches', | ||
things: [ | ||
{ description: 'Cucumber and Peanutbutter' }, | ||
{ description: 'Wasabe Muffuletta'}, | ||
{ description: 'Ice Cream Burger' } | ||
] | ||
}, { | ||
label: 'Haircuts', | ||
things: [ | ||
{ description: 'One Direction' }, | ||
{ description: 'Inverse Beehive' }, | ||
{ description: '"The Cellist"' } | ||
] | ||
}, { | ||
label: 'Cars', | ||
things: [ | ||
{ description: 'The Smart Car' }, | ||
{ description: 'The Dumb Car' }, | ||
{ description: 'Delorean on Fire' } | ||
] | ||
} | ||
])); | ||
} | ||
}); |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<p> | ||
Anything that is valid within a <code><select></code> is also valid within <code><x-select></code>: | ||
<button {{action "populate"}}>Populate</button> | ||
</p> | ||
<p> | ||
{{#x-select value=thing}} | ||
<option>Choose one of the following zaney options! ...</option> | ||
{{#each groupsOfZanyThings as |group|}} | ||
<optgroup label={{group.label}}> | ||
{{#each group.things as |thing|}} | ||
{{#x-option value=thing}}{{thing.description}}{{/x-option}} | ||
{{/each}} | ||
</optgroup> | ||
{{/each}} | ||
{{/x-select}} | ||
</p> |