Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
414fb974
Commit
414fb974
authored
Oct 24, 2019
by
Angie Byron
Browse files
Revert "Issue
#3085908
by bnjmnm, dww, nightlife2008: Blurry/skewed thumbnails in IE11"
This reverts commit
a0539080
.
parent
273bf8e1
Changes
2
Hide whitespace changes
Inline
Side-by-side
core/modules/media_library/css/media_library.theme.css
View file @
414fb974
...
...
@@ -387,16 +387,6 @@
overflow
:
hidden
;
text-align
:
center
;
background-color
:
#ebebeb
;
background-size
:
0
;
}
/* Required for IE11 due to it not supporting object-fit */
/* @todo Remove this cruft when core officially drops support for IE11. */
/* @see https://www.drupal.org/project/drupal/issues/3089196 */
@media
screen
and
(
-ms-high-contrast
:
active
),
screen
and
(
-ms-high-contrast
:
none
)
{
.media-library-item--grid
.field--name-thumbnail
{
background-size
:
auto
;
}
}
.media-library-item--grid
.field--name-thumbnail
img
{
...
...
@@ -405,15 +395,6 @@
object-position
:
center
center
;
}
/* Required for IE11 due to it not supporting object-fit */
/* @todo Remove this cruft when core officially drops support for IE11. */
/* @see https://www.drupal.org/project/drupal/issues/3089196 */
@media
screen
and
(
-ms-high-contrast
:
active
),
screen
and
(
-ms-high-contrast
:
none
)
{
.media-library-item--grid
.field--name-thumbnail
img
{
opacity
:
0
;
}
}
.media-library-item--grid.is-hover
:before
,
.media-library-item--grid.checked
:before
,
.media-library-item--grid.is-focus
:before
{
...
...
core/modules/media_library/media_library.module
View file @
414fb974
...
...
@@ -17,7 +17,6 @@
use
Drupal\Core\Session\AccountInterface
;
use
Drupal\Core\Template\Attribute
;
use
Drupal\Core\Url
;
use
Drupal\file\Entity\File
;
use
Drupal\image\Entity\ImageStyle
;
use
Drupal\image\Plugin\Field\FieldType\ImageItem
;
use
Drupal\media\MediaTypeForm
;
...
...
@@ -95,27 +94,6 @@ function media_library_theme() {
];
}
/**
* Implements hook_preprocess_field().
*
* @todo Remove this cruft when core officially drops support for IE11.
* @see https://www.drupal.org/project/drupal/issues/3089196
*/
function
media_library_preprocess_field
(
&
$variables
,
$hook
)
{
// IE11 does not support object-fit, so the thumbnail image is added as a
// background image that is seen only in IE11.
$element
=
$variables
[
'element'
];
if
(
$element
[
'#view_mode'
]
===
'media_library'
&&
$element
[
'#field_name'
]
===
'thumbnail'
&&
!
empty
(
$element
[
0
][
'#item'
]))
{
if
(
get_class
(
$element
[
0
][
'#item'
])
===
ImageItem
::
class
)
{
if
(
$fid
=
$element
[
0
][
'#item'
]
->
target_id
)
{
$uri
=
File
::
load
(
$fid
)
->
getFileUri
();
$image_url
=
ImageStyle
::
load
(
$element
[
0
][
'#image_style'
])
->
buildUrl
(
$uri
);
$variables
[
'attributes'
][
'style'
]
=
"background-image: url(
$image_url
); background-repeat: no-repeat; background-position: center;"
;
}
}
}
}
/**
* Implements hook_views_post_render().
*/
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment