+
-
+
@@ -234,7 +247,9 @@ export default {
carouselCursor: 0,
visibility: 'public',
mediaDrawer: false,
- composeState: 'publish'
+ composeState: 'publish',
+ uploading: false,
+ uploadProgress: 0
}
},
@@ -323,6 +338,7 @@ export default {
$(document).on('change', '.file-input', function(e) {
let io = document.querySelector('.file-input');
Array.prototype.forEach.call(io.files, function(io, i) {
+ self.uploading = true;
if(self.media && self.media.length + i >= self.config.uploader.album_limit) {
swal('Error', 'You can only upload ' + self.config.uploader.album_limit + ' photos per album', 'error');
return;
@@ -341,6 +357,7 @@ export default {
let xhrConfig = {
onUploadProgress: function(e) {
let progress = Math.round( (e.loaded * 100) / e.total );
+ self.uploadProgress = progress;
}
};
@@ -349,8 +366,8 @@ export default {
self.ids.push(e.data.id);
self.media.push(e.data);
setTimeout(function() {
- self.mediaDrawer = true;
- }, 1000);
+ self.uploading = false;
+ }, 500);
}).catch(function(e) {
swal('Oops, something went wrong!', 'An unexpected error occurred.', 'error');
});