Do not close media thickbox after thumbnail is selected, in case uploads are in progress. see #10928
git-svn-id: https://develop.svn.wordpress.org/trunk@12031 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
459e0bcfc9
commit
6d99e52613
@ -5,7 +5,4 @@ function WPSetThumbnailID(id){
|
||||
if ( jQuery('input[value=_thumbnail_id]').size() > 0 ) {
|
||||
jQuery('#meta\\[' + jQuery('input[value=_thumbnail_id]').attr('id').match(/[0-9]+/) + '\\]\\[value\\]' ).text(id);
|
||||
}
|
||||
}
|
||||
function WPCloseTB(){
|
||||
tb_remove();
|
||||
}
|
@ -1 +1 @@
|
||||
function WPSetThumbnailHTML(html){jQuery("#postthumbnaildiv .inside").html(html)}function WPSetThumbnailID(id){if(jQuery("input[value=_thumbnail_id]").size()>0){jQuery("#meta\\["+jQuery("input[value=_thumbnail_id]").attr("id").match(/[0-9]+/)+"\\]\\[value\\]").text(id)}}function WPCloseTB(){tb_remove()};
|
||||
function WPSetThumbnailHTML(html){jQuery("#postthumbnaildiv .inside").html(html)}function WPSetThumbnailID(id){if(jQuery("input[value=_thumbnail_id]").size()>0){jQuery("#meta\\["+jQuery("input[value=_thumbnail_id]").attr("id").match(/[0-9]+/)+"\\]\\[value\\]").text(id)}};
|
@ -12,7 +12,6 @@ function WPSetAsThumbnail(id){
|
||||
jQuery('#media-item-' + id + ' > a.wp-post-thumbnail').hide();
|
||||
win.WPSetThumbnailID(id);
|
||||
win.WPSetThumbnailHTML(str);
|
||||
win.WPCloseTB();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
@ -1 +1 @@
|
||||
function WPSetAsThumbnail(id){jQuery("#media-item-"+id+" > a.wp-post-thumbnail").text(setPostThumbnailL10n.saving).attr("href","#");jQuery.post(ajaxurl,{action:"set-post-thumbnail",post_id:post_id,thumbnail_id:id,cookie:encodeURIComponent(document.cookie)},function(str){var win=window.dialogArguments||opener||parent||top;if(str=="0"){alert(setPostThumbnailL10n.error);win.cwsCloseTB()}else{jQuery("a.wp-post-thumbnail").text(setPostThumbnailL10n.setThumbnail);jQuery("#media-item-"+id+" > a.wp-post-thumbnail").hide();win.WPSetThumbnailID(id);win.WPSetThumbnailHTML(str);win.WPCloseTB()}})};
|
||||
function WPSetAsThumbnail(id){jQuery("#media-item-"+id+" > a.wp-post-thumbnail").text(setPostThumbnailL10n.saving).attr("href","#");jQuery.post(ajaxurl,{action:"set-post-thumbnail",post_id:post_id,thumbnail_id:id,cookie:encodeURIComponent(document.cookie)},function(str){var win=window.dialogArguments||opener||parent||top;if(str=="0"){alert(setPostThumbnailL10n.error);win.cwsCloseTB()}else{jQuery("a.wp-post-thumbnail").text(setPostThumbnailL10n.setThumbnail);jQuery("#media-item-"+id+" > a.wp-post-thumbnail").hide();win.WPSetThumbnailID(id);win.WPSetThumbnailHTML(str)}})};
|
@ -375,7 +375,7 @@ function wp_default_scripts( &$scripts ) {
|
||||
$scripts->add( 'image-edit', "/wp-admin/js/image-edit$suffix.js", array('jquery', 'json2', 'imgareaselect'), '20090929' );
|
||||
$scripts->add_data( 'image-edit', 'group', 1 );
|
||||
|
||||
$scripts->add( 'set-post-thumbnail', "/wp-admin/js/set-post-thumbnail$suffix.js", array( 'jquery' ), '20091005' );
|
||||
$scripts->add( 'set-post-thumbnail', "/wp-admin/js/set-post-thumbnail$suffix.js", array( 'jquery' ), '20091014' );
|
||||
$scripts->add_data( 'set-post-thumbnail', 'group', 1 );
|
||||
$scripts->localize( 'set-post-thumbnail', 'setPostThumbnailL10n', array(
|
||||
'setThumbnail' => __( 'Use for thumbnail' ),
|
||||
@ -383,7 +383,7 @@ function wp_default_scripts( &$scripts ) {
|
||||
'error' => __( 'Could not set that as the thumbnail image. Try a different attachment.' )
|
||||
) );
|
||||
|
||||
$scripts->add( 'set-post-thumbnail-handler', "/wp-admin/js/set-post-thumbnail-handler$suffix.js", array( 'jquery' ), '20091005' );
|
||||
$scripts->add( 'set-post-thumbnail-handler', "/wp-admin/js/set-post-thumbnail-handler$suffix.js", array( 'jquery' ), '20091014' );
|
||||
$scripts->add_data( 'set-post-thumbnail-handler', 'group', 1 );
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user