Grabs x,y,w,h from hidden inputs if it is set, otherwise, it will use
defaults
This commit is contained in:
parent
41f74218f2
commit
a39bb4a3b8
@ -1,7 +1,12 @@
|
|||||||
$(function(){
|
$(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({
|
jQuery("#avatar_original img").Jcrop({
|
||||||
onChange: showPreview,
|
onChange: showPreview,
|
||||||
setSelect: [ 0, 0, $("#avatar_original img").attr("width"), $("#avatar_original img").attr("height") ],
|
setSelect: [ x, y, w, h ],
|
||||||
onSelect: updateCoords,
|
onSelect: updateCoords,
|
||||||
aspectRatio: 1,
|
aspectRatio: 1,
|
||||||
boxWidth: 480,
|
boxWidth: 480,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user