Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dropzone.options.myAwesomeDropzone = { // The camelized version of the ID of the form element
- // The configuration we've talked about above
- autoProcessQueue: false,
- uploadMultiple: true,
- parallelUploads: 100,
- maxFiles: 100,
- paramName: "thumbs",
- addRemoveLinks: true,
- dictRemoveFile: 'Удалить',
- url: "{{ url('dashboard/files/edit',$gallery['id']) }}",
- // The setting up of the dropzone
- init: function() {
- var myDropzone = this;
- // First change the button to actually tell Dropzone to process the queue.
- this.element.querySelector("button[type=submit]").addEventListener("click", function(e) {
- // Make sure that the form isn't actually being sent.
- e.preventDefault();
- e.stopPropagation();
- myDropzone.processQueue();
- });
- // Listen to the sendingmultiple event. In this case, it's the sendingmultiple event instead
- // of the sending event because uploadMultiple is set to true.
- this.on("sendingmultiple", function() {
- // Gets triggered when the form is actually being sent.
- // Hide the success button or the complete form.
- });
- this.on("successmultiple", function(files, response) {
- // Gets triggered when the files have successfully been sent.
- // Redirect user or notify of success.
- swal({
- title: "Готово!",
- text: "Все сделали, все загрузили и создали! Добавим еще, что - то?",
- type: "success",
- showCancelButton: false,
- closeOnConfirm: true,
- animation: "slide-from-top",
- inputPlaceholder: "Write something"
- });
- //window.location = "/dashboard/files/list";
- });
- this.on("errormultiple", function(files, response) {
- // Gets triggered when there was an error sending the files.
- // Maybe show form again, and notify user of error
- swal({
- title: "Готово!",
- text: "Все сделали, все загрузили и создали! Добавим еще, что - то?",
- type: "error",
- showCancelButton: false,
- closeOnConfirm: true,
- animation: "slide-from-top",
- inputPlaceholder: "Write something"
- });
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement