diff options
author | sarven <csarven@plantard.controlezvous.ca> | 2009-01-21 21:37:08 +0000 |
---|---|---|
committer | sarven <csarven@plantard.controlezvous.ca> | 2009-01-21 21:37:08 +0000 |
commit | a39bb4a3b8bddfffc02a0c9f3c5666ff3cba2357 (patch) | |
tree | 30aeaee12a6da4c7005b5b6d2387791a7b461be7 | |
parent | 41f74218f2ab70b78ba96d386b41fb6a1f958f75 (diff) |
Grabs x,y,w,h from hidden inputs if it is set, otherwise, it will use
defaults
-rw-r--r-- | js/jcrop/jquery.Jcrop.go.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/js/jcrop/jquery.Jcrop.go.js b/js/jcrop/jquery.Jcrop.go.js index d5176c14c..b2737407b 100644 --- a/js/jcrop/jquery.Jcrop.go.js +++ b/js/jcrop/jquery.Jcrop.go.js @@ -1,7 +1,12 @@ $(function(){ + var x = ($('#avatar_crop_x').val()) ? $('#avatar_crop_x').val() : 0; + var y = ($('#avatar_crop_y').val()) ? $('#avatar_crop_y').val() : 0; + var w = ($('#avatar_crop_w').val()) ? $('#avatar_crop_w').val() : $("#avatar_original img").attr("width"); + var h = ($('#avatar_crop_h').val()) ? $('#avatar_crop_h').val() : $("#avatar_original img").attr("height"); + jQuery("#avatar_original img").Jcrop({ onChange: showPreview, - setSelect: [ 0, 0, $("#avatar_original img").attr("width"), $("#avatar_original img").attr("height") ], + setSelect: [ x, y, w, h ], onSelect: updateCoords, aspectRatio: 1, boxWidth: 480, |