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

48 lines
1,008 B
Vue
Raw Normal View History

2016-11-06 19:28:37 +01:00
<template>
2023-05-08 20:49:44 +03:00
<button
2023-04-24 23:01:29 +03:00
class="media-upload"
2023-05-08 20:49:44 +03:00
:class="[normalButton ? 'button-default btn' : 'button-unstyled', { disabled }]"
:title="$t('tool_tip.media_upload')"
@click="onClick"
2020-05-07 16:10:53 +03: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 23:01:29 +03:00
ref="input"
class="hidden-input-file"
:disabled="disabled"
type="file"
multiple="true"
:accept="acceptTypes"
2023-04-24 23:01:29 +03:00
@change="change"
2019-07-05 10:17:44 +03:00
>
2023-05-08 20:49:44 +03:00
</button>
2016-11-06 19:28:37 +01:00
</template>
2022-07-31 12:35:48 +03:00
<script src="./media_upload.js"></script>
2016-11-06 19:28:37 +01:00
<style lang="scss">
.media-upload {
.hidden-input-file {
2022-05-16 23:46:32 +03:00
display: none;
}
}
label.media-upload {
cursor: pointer; // We use <label> for interactivity... i wonder if it's fine
}
</style>