Code Monkey home page Code Monkey logo

Comments (11)

bupy7 avatar bupy7 commented on September 21, 2024

@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.

AhmedEmadAhmedABD avatar AhmedEmadAhmedABD commented on September 21, 2024

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.

bupy7 avatar bupy7 commented on September 21, 2024

@AhmedEmadAhmedABD wow, i have understood. this is feature. after everything options of cropping the main image will disappear.

from js-cropbox.

AhmedEmadAhmedABD avatar AhmedEmadAhmedABD commented on September 21, 2024

but i may need to re crop after reviewing cropped image . is there any solution ?

from js-cropbox.

bupy7 avatar bupy7 commented on September 21, 2024

@AhmedEmadAhmedABD just press the "start" button again. =)

from js-cropbox.

AhmedEmadAhmedABD avatar AhmedEmadAhmedABD commented on September 21, 2024

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.

AhmedEmadAhmedABD avatar AhmedEmadAhmedABD commented on September 21, 2024

can I edit crop event to stop this behavior?

from js-cropbox.

bupy7 avatar bupy7 commented on September 21, 2024

@AhmedEmadAhmedABD I don't understand you. What do you mean?

from js-cropbox.

AhmedEmadAhmedABD avatar AhmedEmadAhmedABD commented on September 21, 2024

untitled

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.

bupy7 avatar bupy7 commented on September 21, 2024

@AhmedEmadAhmedABD no, this can do each of developers himself. Just call "start" again.

from js-cropbox.

bupy7 avatar bupy7 commented on September 21, 2024

No activity.

from js-cropbox.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.