I implemented the hook to use Filefield Sources with Imagefield Crop (current dev)

function mymodule_filefield_sources_widgets() {
  return array('imagefield_crop_widget');
}

This works fine, but the JavaScript is broken. Clicking on a link above the field does not change the original widget. In Chrome debugger i drilled down to the problem:

$fileFieldElement = $(this).parents('div.form-managed-file:first');

This does not match for Imagefield crop here the

<div class="imagefield-crop-widget form-managed-file clearfix"></div>

is empty.

I changed the JavaScript to

$fileFieldElement = $(this).parents('div.form-type-managed-file:first');

And now it works, but have some more problems with image crop....

Comments

quicksketch’s picture

Category: bug » support

Please do not file questions about your own code as a bug report.

I suggest just using https://drupal.org/project/imagefield_focus, which works directly without any changes.

k4v’s picture

Status: Active » Closed (fixed)
SKAUGHT’s picture

Issue summary: View changes

yes, changing to imagefield_focus is one solution. however, is not the ticket request. please reopen.