@miguelcamba
@cibernox
miguelcamba.com
<div class="basic-dropdown-trigger" onmousedown={{action "toggle"}}>
{{yield to="inverse"}}
</div>
{{#if opened}}
{{#ember-wormhole to=_wormholeDestination}}
<div class="ember-basic-dropdown-content">
{{yield (action "open") (action "close")}}
</div>
{{/ember-wormhole}}
{{/if}}
{{yield (action "open") (action "close")}}
{{#basic-dropdown as |open close|}}
<button onclick={{close}}>Dismiss</button>
{{/basic-dropdown}}
<div class="basic-dropdown-trigger" onmousedown={{action "toggle"}}>
{{yield to="inverse"}}
</div>
{{#if opened}}
{{#ember-wormhole to=_wormholeDestination}}
<div class="ember-basic-dropdown-content">
{{yield (action "open") (action "close")}}
</div>
{{/ember-wormhole}}
{{/if}}
{{yield (hash open=(action "open") close=(action "close"))}}
{{#basic-dropdown as |dropdown|}}
<button onclick={{dropdown.close}}>Dismiss</button>
{{/basic-dropdown}}
<div class="basic-dropdown-trigger" onmousedown={{action "toggle"}}>
{{yield to="inverse"}}
</div>
{{#if opened}}
{{#ember-wormhole to=_wormholeDestination}}
<div class="ember-basic-dropdown-content">
{{yield (hash
opened=opened
actions=(hash
open=(action "open")
close=(action "close")
)
)}}
</div>
{{/ember-wormhole}}
{{/if}}
{{yield (hash
opened=opened
actions=(hash
open=(action "open")
close=(action "close")
)
)}}
{{#basic-dropdown as |dropdown|}}
<button onclick={{dropdown.actions.close}}>
Dismiss
</button>
{{/basic-dropdown}}
{{#basic-dropdown as |dropdown|}}
{{#with (hash
isOpen=dropdown.isOpen
actions=(hash
open=(action dropdown.actions.open)
close=(action dropdown.actions.close)
select=(action "select" dropdown)
highlight=(action "highlight" dropdown)
search=(action "search" dropdown)
)) as |select|}}
<input type="text" oninput={{select.actions.search}}>
{{/with}}
{{#basic-dropdown as |dropdown|}}
{{#with (hash
isOpen=dropdown.isOpen
actions=(hash
open=(action dropdown.actions.open)
close=(action dropdown.actions.close)
select=(action "select" dropdown)
highlight=(action "highlight" dropdown)
search=(action "search" dropdown)
)) as |select|}}
<input type="text" oninput={{select.actions.search}}>
{{/with}}
{{#power-select ... onchange=(action "foo") as |opt|}}
{{opt}}
{{/power-select}}
actions: {
foo(newValue, select, e) {
this.set('selected', newValue);
select.actions.close();
}
}