Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug report (upload) : when you change your mind #379

Closed
MisterWP opened this issue Sep 15, 2017 · 3 comments
Closed

Bug report (upload) : when you change your mind #379

MisterWP opened this issue Sep 15, 2017 · 3 comments

Comments

@MisterWP
Copy link

First of all, thank you (in upper case) for your amazing framework !

I found a small bug in your demo site. Cropping deformation after changing pic on croppie upload... Sorry for my english, it's not clear, so I record my screen to show you : https://youtu.be/OTMJTBkHx2M

see you

@thedustinsmith
Copy link
Contributor

Thanks for the video, that was really helpful. The issue you found seems to be the same as #357 and #352.

@MisterWP
Copy link
Author

MisterWP commented Sep 15, 2017

Oh, yes, thanks! Anyway, I added a "Reset" button to destroy the croppie instance. It's fix the issue.

Basically, if some travelers want pick some lines of this :

<button id="restartUpload" type="button">Reset</button>

// bla bla here

jQuery('#upload').on('change', function () { 
            console.log('change'); 
            // warnings before submit
            jQuery('#envoi-souris').prop('disabled', true); 
            jQuery('#validation-warning').css('display', 'inline'); 
            // change the buttons
            jQuery('.file-btn').css('display', 'none'); 
            jQuery('.vanilla-rotate').css('display', 'inline'); 
            jQuery('#restartUpload').css('display', 'inline'); 
            jQuery('.upload-result').css('display', 'inline');
            readFile(this); 
        });
        
        jQuery('#restartUpload').on('click', function(ev) {
            $uploadCrop.croppie('destroy'); // <---- This is it !
            // change the buttons
            jQuery('.file-btn').css('display', 'inline'); 
            jQuery('.vanilla-rotate').css('display', 'none'); 
            jQuery('#restartUpload').css('display', 'none'); 
            jQuery('.upload-result').css('display', 'none'); 
            
            $uploadCrop = jQuery('#upload-demo').croppie({ // <---- Croppie again!
                viewport: {
                    width: 180,
                    height: 180
                },
                boundary: { width: 255, height: 255 },
                enableExif: true
            });
        });

@thedustinsmith
Copy link
Contributor

Thanks for the code. Closing since there's a workaround and it'll be fixed in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants