decide.nolog.cz/app/components/save-button.hbs
2023-11-05 12:19:47 +01:00

27 lines
No EOL
786 B
Handlebars

<BsButton
@type="primary"
{{!
Due to a bug in Ember, conditional modifiers cannot be used with the "on"
modifier. Need to always apply the modifier and fallback to a noop function
(returned by noop helper) instead of only applying the modifier when needed.
See https://github.com/emberjs/ember.js/issues/19869.
}}
{{on "click" (if @onClick @onClick (noop))}}
class="cr-steps-bottom-nav__button cr-steps-bottom-nav__next-button next"
type="submit"
...attributes
>
<span class="cr-steps-bottom-nav__label">
{{#if (has-block)}}
{{yield}}
{{else}}
{{t "action.save"}}
{{/if}}
</span>
{{#if @isPending}}
<LoadingSpinner />
{{else}}
<span class="cr-steps-bottom-nav__icon oi oi-circle-check"></span>
{{/if}}
</BsButton>