Set default coords for cropper. Props yoavf. fixes #9526
git-svn-id: https://develop.svn.wordpress.org/trunk@10925 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
2b03edd1a6
commit
2534eee04b
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user