Created
October 8, 2017 15:09
-
-
Save basz/b03cbd35c6775b7087d78acb57bc6ce7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| {{#bs-dropdown direction="up" as |dd|}} | |
| {{#dd.button title=(t 'commands.copy') | |
| size="sm" type="secondary" | |
| disabled=(not (get model.addresses model.activeLabelId))}} | |
| {{fa-icon "copy"}} | |
| <span class="d-none d-lg-inline-block">{{t 'commands.copy'}}</span> | |
| {{/dd.button}} | |
| {{#dd.menu as |ddm|}} | |
| <p class="muted">Copy from existing address</p> | |
| {{#each model.labels as |label|}} | |
| {{#if (and (not-eq model.activeLabelId label) (get model.addresses label))}} | |
| {{#ddm.item}} | |
| // a button with an action, works but the dropdown isn't closed | |
| {{#bs-button onClick=(action 'copyAddressFromInto' label model.activeLabelId) size="sm" type="link" toggle=false}} | |
| {{t (concat 'menu.address-' label)}} | |
| {{/bs-button}} | |
| {{/ddm.item}} | |
| {{/if}} | |
| {{/each}} | |
| {{/dd.menu}} | |
| {{/bs-dropdown}} |
This file contains hidden or 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
| {{#bs-dropdown direction="up" as |dd|}} | |
| {{#dd.button title=(t 'commands.copy') | |
| size="sm" type="secondary" | |
| disabled=(not (get model.addresses model.activeLabelId))}} | |
| {{fa-icon "copy"}} | |
| <span class="d-none d-lg-inline-block">{{t 'commands.copy'}}</span> | |
| {{/dd.button}} | |
| {{#dd.menu as |ddm|}} | |
| <p class="muted">Copy from existing address</p> | |
| {{#each model.labels as |label|}} | |
| {{#if (and (not-eq model.activeLabelId label) (get model.addresses label))}} | |
| {{#ddm.item}} | |
| // a link-to does not make sense because it doesn't call an action. It does close te dropdown though | |
| {{#ddm.link-to 'account.customer-profile.settings'}} | |
| {{t (concat 'menu.address-' label)}} | |
| {{/ddm.link-to}} | |
| {{/ddm.item}} | |
| {{/if}} | |
| {{/each}} | |
| {{/dd.menu}} | |
| {{/bs-dropdown}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment