Upload files to a book from show book view.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
// mydropzone_controller.js
|
||||
|
||||
import { Controller } from '@hotwired/stimulus';
|
||||
import axios from 'axios';
|
||||
|
||||
export default class extends Controller {
|
||||
connect() {
|
||||
@@ -18,19 +19,27 @@ export default class extends Controller {
|
||||
|
||||
_onConnect(event) {
|
||||
// The dropzone was just created
|
||||
console.info(event);
|
||||
// console.info(event);
|
||||
console.info('onconnect');
|
||||
//
|
||||
// axios.get('/book/search/modyfikowany+węgiel').then(response => {
|
||||
// console.info(response.data);
|
||||
// });
|
||||
|
||||
}
|
||||
|
||||
_onChange(event) {
|
||||
// The dropzone just changed
|
||||
console.info(event);
|
||||
console.info('onchange');
|
||||
|
||||
event.target.closest('form').submit();
|
||||
|
||||
}
|
||||
|
||||
_onClear(event) {
|
||||
// The dropzone has just been cleared
|
||||
console.info(event);
|
||||
// console.info(event);
|
||||
console.info('onclear');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user