Set default coords for cropper. Props yoavf. fixes #9526

git-svn-id: http://svn.automattic.com/wordpress/trunk@10925 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-04-13 17:00:51 +00:00
parent 30f16a34a7
commit b3c631cc1f
1 changed files with 9 additions and 0 deletions

View File

@ -232,6 +232,15 @@ class Custom_Image_Header {
var ratio = xinit / yinit;
var ximg = jQuery('#upload').width();
var yimg = jQuery('#upload').height();
//set up default values
jQuery( '#x1' ).val(0);
jQuery( '#y1' ).val(0);
jQuery( '#x2' ).val(xinit);
jQuery( '#y2' ).val(yinit);
jQuery( '#width' ).val(xinit);
jQuery( '#height' ).val(yinit);
if ( yimg < yinit || ximg < xinit ) {
if ( ximg / yimg > ratio ) {
yinit = yimg;