-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for disabled items, fixes #5
- Loading branch information
Brenna
committed
Oct 29, 2015
1 parent
e4aaa0e
commit 8eee9b8
Showing
9 changed files
with
79 additions
and
20 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
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
13 changes: 13 additions & 0 deletions
13
tests/dummy/app/pods/components/examples/example-disabled/component.js
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,13 @@ | ||
import Ember from 'ember'; | ||
|
||
// BEGIN-SNIPPET example-default | ||
export default Ember.Component.extend({ | ||
classNames: 'Example', | ||
setBySearchable: null, | ||
actions: { | ||
update(selection){ | ||
this.set('setBySearchable', selection); | ||
} | ||
} | ||
}); | ||
// END-SNIPPET |
21 changes: 21 additions & 0 deletions
21
tests/dummy/app/pods/components/examples/example-disabled/template.hbs
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,21 @@ | ||
<h3>Disabled options</h3> | ||
<p>Just like a real select menu, you can disable menu items. Pass in a item key to use as a flag; when true the item will not be selectable. If you don't have an existing model key that evaluates to true/false, you can set up a computed property on the content model that returns a boolean value.</p> | ||
<br> | ||
<div class="row"> | ||
<div class="col-md-6"> | ||
{{code-snippet name="disabled.hbs"}} | ||
</div> | ||
<div class="col-md-6"> | ||
|
||
{{!-- BEGIN-SNIPPET disabled --}} | ||
{{searchable-select | ||
content=TEDevents | ||
sortBy="title" | ||
optionDisabledKey="isTEDxEvent" | ||
on-change=(action "update")}} | ||
|
||
<p>Set by Searchable: {{setBySearchable.title}}</p> | ||
{{!-- END-SNIPPET --}} | ||
|
||
</div> | ||
</div> |
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
7 changes: 5 additions & 2 deletions
7
tests/dummy/app/pods/components/examples/two-way-bound/template.hbs
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