[ Index ]

WordPress Cross Reference

title

Body

[close]

/wp-admin/js/ -> media-gallery.js (source)

   1  /* global ajaxurl */
   2  jQuery(function($){
   3      $( 'body' ).bind( 'click.wp-gallery', function(e){
   4          var target = $( e.target ), id, img_size;
   5  
   6          if ( target.hasClass( 'wp-set-header' ) ) {
   7              ( window.dialogArguments || opener || parent || top ).location.href = target.data( 'location' );
   8              e.preventDefault();
   9          } else if ( target.hasClass( 'wp-set-background' ) ) {
  10              id = target.data( 'attachment-id' );
  11              img_size = $( 'input[name="attachments[' + id + '][image-size]"]:checked').val();
  12  
  13              jQuery.post(ajaxurl, {
  14                  action: 'set-background-image',
  15                  attachment_id: id,
  16                  size: img_size
  17              }, function(){
  18                  var win = window.dialogArguments || opener || parent || top;
  19                  win.tb_remove();
  20                  win.location.reload();
  21              });
  22  
  23              e.preventDefault();
  24          }
  25      });
  26  });


Generated: Tue Mar 25 01:41:18 2014 WordPress honlapkészítés: online1.hu