Vue event bus, uploading files handles from file service.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// mydropzone_controller.js
|
||||
// filedropzone_controller.js
|
||||
|
||||
import { Controller } from '@hotwired/stimulus';
|
||||
import axios from 'axios';
|
||||
@@ -19,13 +19,7 @@ export default class extends Controller {
|
||||
|
||||
_onConnect(event) {
|
||||
// The dropzone was just created
|
||||
// console.info(event);
|
||||
console.info('onconnect');
|
||||
//
|
||||
// axios.get('/book/search/modyfikowany+węgiel').then(response => {
|
||||
// console.info(response.data);
|
||||
// });
|
||||
|
||||
}
|
||||
|
||||
_onChange(event) {
|
||||
@@ -36,14 +30,13 @@ export default class extends Controller {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
}).then(() => {
|
||||
event.target.querySelector('.dropzone-preview-button').click()
|
||||
event.target.querySelector('.dropzone-preview-button').click();
|
||||
window.EventBus.$emit('fileUploaded');
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
_onClear(event) {
|
||||
// The dropzone has just been cleared
|
||||
// console.info(event);
|
||||
console.info('onclear');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user