@@ -18,6 +18,8 @@ $(function () {
18
18
var metaNode = $ ( '#meta' )
19
19
var thumbNode = $ ( '#thumbnail' )
20
20
var actionsNode = $ ( '#actions' )
21
+ var orientationNode = $ ( '#orientation' )
22
+ var imageSmoothingNode = $ ( '#image-smoothing' )
21
23
var coordinates
22
24
var jcropAPI
23
25
@@ -148,8 +150,8 @@ $(function () {
148
150
canvas : true ,
149
151
pixelRatio : window . devicePixelRatio ,
150
152
downsamplingRatio : 0.5 ,
151
- orientation : Number ( $ ( '#orientation' ) . val ( ) ) || true ,
152
- imageSmoothingEnabled : $ ( '#image-smoothing' ) . is ( ':checked' ) ,
153
+ orientation : Number ( orientationNode . val ( ) ) || true ,
154
+ imageSmoothingEnabled : imageSmoothingNode . is ( ':checked' ) ,
153
155
meta : true
154
156
}
155
157
metaNode . hide ( ) . find ( 'table' ) . remove ( )
@@ -213,15 +215,15 @@ $(function () {
213
215
214
216
$ ( '#url' ) . on ( 'change paste input' , urlChangeHandler )
215
217
216
- $ ( '#orientation' ) . on ( 'change' , function ( ) {
218
+ orientationNode . on ( 'change' , function ( ) {
217
219
var img = result . find ( 'img, canvas' ) [ 0 ]
218
220
if ( img ) {
219
221
updateResults (
220
222
loadImage . scale ( img , {
221
223
maxWidth : result . width ( ) * ( window . devicePixelRatio || 1 ) ,
222
224
pixelRatio : window . devicePixelRatio ,
223
- orientation : Number ( $ ( '#orientation' ) . val ( ) ) || true ,
224
- imageSmoothingEnabled : $ ( '#image-smoothing' ) . is ( ':checked' )
225
+ orientation : Number ( orientationNode . val ( ) ) || true ,
226
+ imageSmoothingEnabled : imageSmoothingNode . is ( ':checked' )
225
227
} )
226
228
)
227
229
}
@@ -274,7 +276,7 @@ $(function () {
274
276
maxWidth : result . width ( ) * pixelRatio ,
275
277
contain : true ,
276
278
pixelRatio : pixelRatio ,
277
- imageSmoothingEnabled : $ ( '#image-smoothing' ) . is ( ':checked' )
279
+ imageSmoothingEnabled : imageSmoothingNode . is ( ':checked' )
278
280
} )
279
281
)
280
282
coordinates = null
0 commit comments