sconsult / croppic

croppic
914 stars 228 forks source link

Reset don't work when using preload (if the picture is already available) #255

Open carlosfvieira opened 7 years ago

carlosfvieira commented 7 years ago

image

In the example above, taken from the site, you can see that, by clicking the reset button (X), the container is not reset... when we click on X, user should have the possbility to upload new image, but nothing happens...

vididesign commented 7 years ago

For solving this I made a button with id "delimgbutton" and added this script to reinit croppic:

$('#delimgbutton').on("click",function(){
        cropper.destroy();
        var cropperOptions = {
            "croppic options without **loadPicture** param"
        }
        cropper = new Croppic('pictureupload', cropperOptions);
})
yasermarakkar commented 5 years ago

hi , please open your plugin js file. find the method reset:function() and add the following line after that.destroy(); :- `that.options.loadPicture = '';