2 $( 'body' ).bind( 'click.wp-gallery', function(e){
3 var target = $( e.target ), id, img_size;
5 if ( target.hasClass( 'wp-set-header' ) ) {
6 ( window.dialogArguments || opener || parent || top ).location.href = target.data( 'location' );
8 } else if ( target.hasClass( 'wp-set-background' ) ) {
9 id = target.data( 'attachment-id' );
10 img_size = $( 'input[name="attachments[' + id + '][image-size]"]:checked').val();
12 jQuery.post(ajaxurl, {
13 action: 'set-background-image',
17 var win = window.dialogArguments || opener || parent || top;
19 win.location.reload();