diff --git a/src/wp-admin/includes/image-edit.php b/src/wp-admin/includes/image-edit.php index 2f474d4caa..4be465d3db 100644 --- a/src/wp-admin/includes/image-edit.php +++ b/src/wp-admin/includes/image-edit.php @@ -190,7 +190,7 @@ function wp_image_editor( $post_id, $msg = false ) {
- + max2 ? max2 / max1 : 1; t.initCrop(postid, img, parent); - t.setCropSelection(postid, 0); if ( (typeof callback !== 'undefined') && callback !== null ) { callback(); @@ -579,7 +603,8 @@ } this.initCrop(postid, img, parent); - this.setCropSelection(postid, 0); + this.setCropSelection( postid, { 'x1': 0, 'y1': 0, 'x2': 0, 'y2': 0, 'width': img.innerWidth(), 'height': img.innerHeight() } ); + this.toggleEditor(postid, 0); // Editor is ready, move focus to the first focusable element. $( '.imgedit-wrap .imgedit-help-toggle' ).eq( 0 ).focus(); @@ -703,8 +728,8 @@ c = c || 0; if ( !c || ( c.width < 3 && c.height < 3 ) ) { - this.setDisabled($('.imgedit-crop', '#imgedit-panel-' + postid), 0); - this.setDisabled($('#imgedit-crop-sel-' + postid), 0); + this.setDisabled( $( '.imgedit-crop', '#imgedit-panel-' + postid ), 1 ); + this.setDisabled( $( '#imgedit-crop-sel-' + postid ), 1 ); $('#imgedit-sel-width-' + postid).val(''); $('#imgedit-sel-height-' + postid).val(''); $('#imgedit-selection-' + postid).val('');