Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dropzone.options.myAwesomeDropzone = {
- paramName: "file", // The name that will be used to transfer the file
- maxFilesize: 2, // MB
- parallelUploads: 1,
- success: function(file, response) {
- var imageSrc = response;
- $(".img-responsive").attr('src', imageSrc);
- if (imageSrc == '/assets/images/offerfeatimg.jpg') {
- $(".removebutton").hide();
- } else {
- $(".removebutton").show();
- }
- }
- };
- success: function (file, response) {
- this.removeFile(file);
- }
- Dropzone.options.myAwesomeDropzone = {
- paramName: "file",
- maxFilesize: 2,
- parallelUploads: 1,
- init: function() {
- this.on("success", function(file, response) {
- var imageSrc = response;
- $(".img-responsive").attr('src', imageSrc);
- if(imageSrc == '/assets/images/offerfeatimg.jpg') {
- $(".removebutton").hide();
- } else {
- $(".removebutton").show();
- }
- this.removeFile(file); // This line removes the preview
- })
- }
- };
- .dz-preview, .dz-file-preview {
- display: none;
- }
- Dropzone.options.myDropzone = {
- paramName: "file",
- maxFilesize: 2, // MB
- url: 'post_image',
- createImageThumbnails: false, // NO THUMBS!
- init: function () {
- this.on('sending', dz_sending),
- this.on('success', dz_success),
- this.on('error', dz_error),
- this.on('complete', dz_complete) // Once it's done...
- }
- function dz_complete(file) {
- $('.dz-preview').remove(); // ...delete the template gen'd html.
- }
- success: function (file, response) {
- file.previewElement.innerHTML = "";
- }
- <div class="dz-preview dz-processing dz-image-preview dz-complete"></div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement