File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -15,15 +15,16 @@ module.exports = class Crop
15
15
@outlineCssClass = ' crop-outline--active'
16
16
17
17
# State
18
- @isReady = false
19
18
@isPanning = false
20
19
@initialCrop = crop
21
20
22
21
# Events
23
- @readyEvent = $ .Callbacks (' memory once' )
24
22
@loadEvent = $ .Callbacks ()
25
23
@changeEvent = $ .Callbacks ()
26
24
25
+ # Sets up the ready event and state
26
+ @ initializeReadyState ()
27
+
27
28
# Confguration
28
29
@zoomInStep = zoomStep
29
30
@zoomOutStep = 1 / @zoomInStep
@@ -44,11 +45,17 @@ module.exports = class Crop
44
45
@ setImage (url)
45
46
46
47
48
+ initializeReadyState : ->
49
+ @isReady = false
50
+ @readyEvent ? .empty ()
51
+ @readyEvent = $ .Callbacks (' memory once' )
52
+
53
+
47
54
setImage : (url ) ->
48
55
return unless url != @preview .url
49
56
50
57
@preview .reset () if @isInitialized
51
- @isReady = false
58
+ @ initializeReadyState ()
52
59
@view .addClass (@loadingCssClass )
53
60
@preview .setImage ({ url })
54
61
You can’t perform that action at this time.
0 commit comments