Closed AhmedEmadAhmedABD closed 6 years ago
@AhmedEmadAhmedABD hi! there is solution, of course. You can use delay after to press the button.
Example:
var cropBtn = document.querySelector('#btn-crop'),
processed = false;
cropBtn.addEventListener('click', function () {
if (processed) {
return;
}
processed = true;
cropbox.crop();
setTimeout(function () {
processed = false;
}, 5000);
});
Or you can use the cb:cropped
event:
// crop
var cropBtn = document.querySelector('#btn-crop'),
processed = false;
cropBtn.addEventListener('click', function(){
if (processed) {
return;
}
processed = true;
cropbox.crop();
});
// the cropped event
cropbox.getCb().addEventListener('cb:cropped', function(event){
processed = false;
});
I tried the 2 solution but the issue still exist. press crop for first time works properly . the second time the main image disappear and 2 cropped image appear below.
@AhmedEmadAhmedABD wow, i have understood. this is feature. after everything options of cropping the main image will disappear.
but i may need to re crop after reviewing cropped image . is there any solution ?
@AhmedEmadAhmedABD just press the "start" button again. =)
I already transferred logic of start button to on load event on upload to load automatically after choosing image :
fileInput.onchange = function (evt) { var fileReader = new FileReader(); fileReader.readAsDataURL(fileInput.files[0]); fileReader.addEventListener('load', function (event) { cropbox.load(event.target.result); }); }
can I edit crop event to stop this behavior?
@AhmedEmadAhmedABD I don't understand you. What do you mean?
as above picture only allowed number of cropping is two then image disappear . can I change this behavior by removing this limit and view always the last cropped image and the original image still appears and can be cropped again
@AhmedEmadAhmedABD no, this can do each of developers himself. Just call "start" again.
No activity.
When you press crop twice image disappear and 2 cropped image appear in bottom? is there any solution for this issue?