From c419700f9384cd224c005e5ab016300966484c19 Mon Sep 17 00:00:00 2001 From: Daryl Koopersmith Date: Wed, 31 Oct 2012 20:34:50 +0000 Subject: [PATCH] Fix positioning of attachment thumbnail overlays. Prevents the overlay from blocking buttons inside the attachment preview, such as the remove button in the gallery editor. see #21390. git-svn-id: http://core.svn.wordpress.org/trunk@22343 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/css/media-views.css | 25 +++++++++++++++---------- wp-includes/media.php | 4 +++- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/wp-includes/css/media-views.css b/wp-includes/css/media-views.css index a95310b4d6..766ada5a29 100644 --- a/wp-includes/css/media-views.css +++ b/wp-includes/css/media-views.css @@ -273,21 +273,13 @@ margin: 0 auto; } -.attachment .thumbnail { - -webkit-transform: translate( 50%, 50% ); - -moz-transform: translate( 50%, 50% ); - -ms-transform: translate( 50%, 50% ); - -o-transform: translate( 50%, 50% ); - transform: translate( 50%, 50% ); -} - /* Vertically center the icons. */ .attachment .icon { top: 50%; left: 50%; } -.attachment-preview:after { +.attachment-preview .thumbnail:after { content: ''; display: block; position: absolute; @@ -304,8 +296,21 @@ left: 0; } +.attachment .thumbnail .centered { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + -webkit-transform: translate( 50%, 50% ); + -moz-transform: translate( 50%, 50% ); + -ms-transform: translate( 50%, 50% ); + -o-transform: translate( 50%, 50% ); + transform: translate( 50%, 50% ); +} + .attachment .icon, -.attachment .thumbnail img { +.attachment .thumbnail .centered img { -webkit-transform: translate( -50%, -50% ); -moz-transform: translate( -50%, -50% ); -ms-transform: translate( -50%, -50% ); diff --git a/wp-includes/media.php b/wp-includes/media.php index 44e3db0892..fd2e754e69 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -1327,7 +1327,9 @@ function wp_print_media_templates( $attachment ) {
<% } else if ( 'image' === type ) { %>
- +
+ +
<% } else { %>