Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Error when not specifying 'build' option #29

Open
cphyc opened this issue Feb 16, 2016 · 1 comment
Open

Error when not specifying 'build' option #29

cphyc opened this issue Feb 16, 2016 · 1 comment

Comments

@cphyc
Copy link

cphyc commented Feb 16, 2016

When not declaring 'build' option, cropper is unable to attach the build event and therefore returns a window object, that cannot be triggered:

The line that fails is this one:

$this.one(EVENT_BUILD, options.build).trigger(buildEvent);)

it throws the error:

TypeError: $this.one(...).trigger is not a function
    at Cropper.prototype.load (ngCropper.all.js:formatted:258)
    at new Cropper (ngCropper.all.js:formatted:230)
    at HTMLImageElement.<anonymous> (ngCropper.all.js:formatted:2201)
    at Function.jQuery.extend.each (jquery.js:360)
    at jQuery.fn.jQuery.each (jquery.js:137)
    at $.fn.cropper (ngCropper.all.js:formatted:2195)
    at ngCropper.all.js:formatted:2249
    at processQueue (angular.js:14745)
    at angular.js:14761
    at Scope.$eval (angular.js:15989)

You should replace the options.build by options.build || function() {}.

@cphyc
Copy link
Author

cphyc commented Feb 16, 2016

There is also the error with a missing options.built function.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant