Comments (11)
@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;
});
from js-cropbox.
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.
from js-cropbox.
@AhmedEmadAhmedABD wow, i have understood. this is feature. after everything options of cropping the main image will disappear.
from js-cropbox.
but i may need to re crop after reviewing cropped image . is there any solution ?
from js-cropbox.
@AhmedEmadAhmedABD just press the "start" button again. =)
from js-cropbox.
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); }); }
from js-cropbox.
can I edit crop event to stop this behavior?
from js-cropbox.
@AhmedEmadAhmedABD I don't understand you. What do you mean?
from js-cropbox.
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
from js-cropbox.
@AhmedEmadAhmedABD no, this can do each of developers himself. Just call "start" again.
from js-cropbox.
No activity.
from js-cropbox.
Related Issues (12)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from js-cropbox.