]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Grabs x,y,w,h from hidden inputs if it is set, otherwise, it will use
authorsarven <csarven@plantard.controlezvous.ca>
Wed, 21 Jan 2009 21:37:08 +0000 (21:37 +0000)
committersarven <csarven@plantard.controlezvous.ca>
Wed, 21 Jan 2009 21:37:08 +0000 (21:37 +0000)
defaults

js/jcrop/jquery.Jcrop.go.js

index d5176c14c265b0bdff642066172a460601e7c503..b2737407bfbba8f3c02bec05211fa4a7f9364251 100644 (file)
@@ -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,