andrefarzat / ng-jcrop

Angular directive to jCrop jQuery plugin
GNU General Public License v2.0
101 stars 39 forks source link

Accidentally using "shade" mode? #38

Closed scottybrown closed 9 years ago

scottybrown commented 9 years ago

JCrop has a shade mode whereby the grey area surrounding the crop selection box is made up of 4 grey squares, rather than a second image with opacity set to appear grey. This can be seen in the JCrop Github tutorial 4 as an experimental feature.

ng-jcrop seems to be using shade mode accidentally. It calls jQuery.Jcrop($scope.mainImg, config), but I think it should be passing in $scope.mainImg[0] which has a tagName set to IMG rather than undefined.

Shade mode seems to work okay so the impact is probably negligible for most users. The impact for us is that we're trying to modify the crop selection to be circular instead of square. This is much more difficult in shade mode.

andrefarzat commented 9 years ago

@scottybrown I see. You're right for this line. Working on that

andrefarzat commented 9 years ago

@scottybrown PR opened : https://github.com/andrefarzat/ng-jcrop/pull/39 Can I ask you to run the demo and see if it was solved for you ? Thanks

scottybrown commented 9 years ago

Yeah no problem. I ran the demo and it all seems good. The 3 demos seem to work and definitely aren't using shade mode. I did get a couple of test failures, not sure if that's something on my end or not. screen shot 2015-11-10 at 4 58 28 pm

andrefarzat commented 9 years ago

Nice catch. Haven't played the tests against chrome/firefox. Fixed :smile_cat:

andrefarzat commented 9 years ago

Can I get your ok ?

scottybrown commented 9 years ago

It seems to be working Chrome, but still makes the first failures on Firefox 42 ("ng-jcrop JcropController getShrinkRatio should return the correct Shrink Ratio")

andrefarzat commented 9 years ago

I am making travis-ci to run Firefox in xvfb. All green in travis-ci https://travis-ci.org/andrefarzat/ng-jcrop :dancer:

scottybrown commented 9 years ago

Oh it does seem to be working now in Firefox. Strange. Must have been something on my end.

For the record this is just me running it locally, with no launchers configured, manually traveling to http://localhost:9876/ in Firefox 42.0.0. All good :+1:

andrefarzat commented 9 years ago

Version 2.1.1 published :smiley_cat: