Skip to content

Commit

Permalink
Clear trash
Browse files Browse the repository at this point in the history
  • Loading branch information
daaner committed May 2, 2020
1 parent 7fee7d9 commit d13b722
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions resources/assets/js_owl/admin/form/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ Vue.component('element-file', Vue.extend({
}
},
mounted () {
this.val = this.value;
this.val = this.value
this.initUpload()
},
methods: {
initUpload () {
let self = this,
container = $(self.$el.parentNode),
button = container.find('.upload-button');
button = container.find('.upload-button')

button.dropzone({
url: this.url,
Expand All @@ -40,41 +40,40 @@ Vue.component('element-file', Vue.extend({

dictDefaultMessage: '',
sending () {
self.uploading = true;
self.uploading = true
self.closeAlert()
},
success (file, response) {
self.val = response.value;
self.val = response.value
},
error (file, response) {
if(_.isArray(response.errors)) {
self.errors = response.errors;
self.errors = response.errors
}
},
complete(){
self.uploading = false;
self.uploading = false
}
});
},
remove () {
var self = this;
var self = this

Admin.Messages.confirm(trans('lang.message.are_you_sure')).then((result) => {
console.log(result);
if(result.value)
self.val = '';
self.val = ''
else
return false;
return false
});
},
closeAlert () {
this.errors = [];
this.errors = []
}
},
computed: {
uploadClass() {
if (!this.uploading) {
return 'fa fa-upload';
return 'fa fa-upload'
}
return 'fa fa-spinner fa-spin'
},
Expand Down

0 comments on commit d13b722

Please sign in to comment.