pinafore/routes/_components/compose/ComposeButton.html

49 lines
1.1 KiB
HTML
Raw Normal View History

2018-02-27 07:22:56 +01:00
<button class="primary compose-box-button"
2018-03-05 01:27:15 +01:00
:disabled
on:click>
<span class="{{$postingStatus ? 'hidden' : ''}}">
Toot!
</span>
<div class="compose-box-button-spinner {{$postingStatus ? 'spin' : 'hidden'}}"
aria-hidden="true">
<svg class="compose-box-button-spinner-svg">
2018-03-05 01:27:15 +01:00
<use xlink:href="#fa-spinner" />
</svg>
</div>
2018-02-27 07:22:56 +01:00
</button>
<style>
.compose-box-button {
grid-area: button;
justify-self: right;
text-transform: uppercase;
margin-top: 10px;
2018-03-05 01:27:15 +01:00
position: relative;
}
.compose-box-button-spinner {
pointer-events: none;
position: absolute;
display: flex;
justify-content: center;
align-items: center;
z-index: 10;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
.compose-box-button-spinner-svg {
2018-03-05 01:27:15 +01:00
width: 24px;
height: 24px;
fill: var(--button-primary-text);
2018-02-27 07:22:56 +01:00
}
</style>
<script>
import { store } from '../../_store/store'
export default {
store: () => store,
computed: {
disabled: ($postingStatus, overLimit) => $postingStatus || overLimit
2018-02-27 07:22:56 +01:00
}
}
</script>