genemu / GenemuFormBundle

Extra Form : Captcha GD, Tinymce, Recaptcha, JQueryDate, JQueryAutocomplete, JQuerySlider, JQueryFile, JQueryImage
586 stars 263 forks source link

ImageType javascript (Jcrop) problem #190

Open alexcasalboni opened 12 years ago

alexcasalboni commented 12 years ago

I'm using the ImageType to upload a file, I've included all the js and css libraries (uploadify and Jcrop), but the clientside code is not working as expected, since the preview image is updated at every filter change but the Jcrop image is not, so I keep on seeing the same image even if the server-side has changed it (and it's actually updated in the $preview img).

Everything works fine (except the crop functionality, of course) if I comment

    $preview.Jcrop({
          onSelect: checkCoords,
          onChange: checkCoords
    }, function() {
          $crop = this;
    });

Maybe you should retreive the $crop in a way similar to

   $crop = $preview.data('Jcrop');

or

   $crop = $preview.Jcrop('api');

A second question: is this line correct? Is the 'data' variable seen by twig? And couldn't the '500' value by configurable, so that I can set how big my preview should be?

Thank you

alexcasalboni commented 12 years ago

Ok I've managed the Jcrop bug, it was just a version problem But I still have problem with the second question: how can I have a configurable width for the preview image? Would css be the only way?

Thanks