File tree Expand file tree Collapse file tree 5 files changed +18
-7
lines changed Expand file tree Collapse file tree 5 files changed +18
-7
lines changed Original file line number Diff line number Diff line change
1
+ # v1.0.1
2
+
3
+ - Avoid infinite loop when setting ratio [ #5 ] ( https://github.com/upfrontIO/srcissors/pull/5 )
4
+
1
5
2
6
# v1.0.0
3
7
17
21
# v0.1.0
18
22
19
23
Initial Release
20
-
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " srcissors" ,
3
- "version" : " 1.0.0 " ,
3
+ "version" : " 1.0.1 " ,
4
4
"homepage" : " https://github.com/upfrontIO/srcissors" ,
5
5
"description" : " Image cropping for responsive images" ,
6
6
"author" : " upfront.io" ,
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " srcissors" ,
3
- "version" : " 1.0.0 " ,
3
+ "version" : " 1.0.1 " ,
4
4
"homepage" : " https://github.com/upfrontIO/srcissors" ,
5
5
"description" : " Image cropping for responsive images" ,
6
6
"author" : " upfront.io" ,
Original file line number Diff line number Diff line change @@ -14,12 +14,11 @@ module.exports = Crop = (function() {
14
14
this . loadingCssClass = 'crop-view--is-loading' ;
15
15
this . panningCssClass = 'crop-view--is-panning' ;
16
16
this . outlineCssClass = 'crop-outline--active' ;
17
- this . isReady = false ;
18
17
this . isPanning = false ;
19
18
this . initialCrop = crop ;
20
- this . readyEvent = $ . Callbacks ( 'memory once' ) ;
21
19
this . loadEvent = $ . Callbacks ( ) ;
22
20
this . changeEvent = $ . Callbacks ( ) ;
21
+ this . initializeReadyState ( ) ;
23
22
this . zoomInStep = zoomStep ;
24
23
this . zoomOutStep = 1 / this . zoomInStep ;
25
24
this . arenaWidth = this . arena . width ( ) ;
@@ -35,14 +34,23 @@ module.exports = Crop = (function() {
35
34
this . setImage ( url ) ;
36
35
}
37
36
37
+ Crop . prototype . initializeReadyState = function ( ) {
38
+ var _ref ;
39
+ this . isReady = false ;
40
+ if ( ( _ref = this . readyEvent ) != null ) {
41
+ _ref . empty ( ) ;
42
+ }
43
+ return this . readyEvent = $ . Callbacks ( 'memory once' ) ;
44
+ } ;
45
+
38
46
Crop . prototype . setImage = function ( url ) {
39
47
if ( url === this . preview . url ) {
40
48
return ;
41
49
}
42
50
if ( this . isInitialized ) {
43
51
this . preview . reset ( ) ;
44
52
}
45
- this . isReady = false ;
53
+ this . initializeReadyState ( ) ;
46
54
this . view . addClass ( this . loadingCssClass ) ;
47
55
return this . preview . setImage ( {
48
56
url : url
You can’t perform that action at this time.
0 commit comments