pleroma-fe/src/components/media_upload/media_upload.vue

51 lines
1 KiB
Vue
Raw Normal View History

2016-11-06 18:28:37 +00:00
<template>
2023-05-08 17:49:44 +00:00
<button
2023-04-24 20:01:29 +00:00
class="media-upload"
2023-05-08 17:49:44 +00:00
:class="[normalButton ? 'button-default btn' : 'button-unstyled', { disabled }]"
:title="$t('tool_tip.media_upload')"
@click="onClick"
2020-05-07 13:10:53 +00:00
>
<FAIcon
v-if="uploading"
class="progress-icon"
icon="circle-notch"
spin
/>
<FAIcon
v-if="!uploading"
class="new-icon"
icon="upload"
/>
<template v-if="normalButton">
{{ ' ' }}
{{ uploading ? $t('general.loading') : $t('tool_tip.media_upload') }}
</template>
<input
v-if="uploadReady"
2023-04-24 20:01:29 +00:00
ref="input"
class="hidden-input-file"
:disabled="disabled"
type="file"
multiple="true"
:accept="acceptTypes"
2023-04-24 20:01:29 +00:00
@change="change"
2019-07-05 07:17:44 +00:00
>
2023-05-08 17:49:44 +00:00
</button>
2016-11-06 18:28:37 +00:00
</template>
2022-07-31 09:35:48 +00:00
<script src="./media_upload.js"></script>
2016-11-06 18:28:37 +00:00
<style lang="scss">
2023-01-09 18:02:16 +00:00
@import "../../variables";
2020-05-07 13:10:53 +00:00
.media-upload {
.hidden-input-file {
2022-05-16 20:46:32 +00:00
display: none;
}
}
label.media-upload {
cursor: pointer; // We use <label> for interactivity... i wonder if it's fine
}
</style>