Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F85629308
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/src/components/media_upload/media_upload.js b/src/components/media_upload/media_upload.js
index 8ae86a8de5..3f2e39641b 100644
--- a/src/components/media_upload/media_upload.js
+++ b/src/components/media_upload/media_upload.js
@@ -1,22 +1,35 @@
/* eslint-env browser */
import statusPosterService from '../../services/status_poster/status_poster.service.js'
const mediaUpload = {
mounted () {
const store = this.$store
const input = this.$el.querySelector('input')
const self = this
input.addEventListener('change', ({target}) => {
const file = target.files[0]
const formData = new FormData()
formData.append('media', file)
+
+ self.$emit('uploading')
+ self.uploading = true
+
statusPosterService.uploadMedia({ store, formData })
.then((fileData) => {
self.$emit('uploaded', fileData)
+ self.uploading = false
+ }, (error) => {
+ self.$emit('upload-failed')
+ self.uploading = false
})
})
+ },
+ data () {
+ return {
+ uploading: false
+ }
}
}
export default mediaUpload
diff --git a/src/components/media_upload/media_upload.vue b/src/components/media_upload/media_upload.vue
index a62d831698..f2f0b83f9a 100644
--- a/src/components/media_upload/media_upload.vue
+++ b/src/components/media_upload/media_upload.vue
@@ -1,17 +1,18 @@
<template>
<div class="media-upload">
<label class="btn btn-default">
- <i class="fa icon-upload"></i>
+ <i class="fa icon-spin4 animate-spin" v-if="uploading"></i>
+ <i class="fa icon-upload" v-if="!uploading"></i>
<input type=file style="position: fixed; top: -100em"></input>
</label>
</div>
</template>
<script src="./media_upload.js" ></script>
<style>
.media-upload {
font-size: 26px;
flex: 1;
}
</style>
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Aug 8, 7:06 PM (1 d, 17 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1723898
Default Alt Text
(1 KB)
Attached To
Mode
rPUFE pleroma-fe-upstream
Attached
Detach File
Event Timeline
Log In to Comment