diff options
author | unarist <m.unarist@gmail.com> | 2017-07-14 08:59:34 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-07-14 01:59:34 +0200 |
commit | eeb5923e89c1b9040df37db8709e3450713c6019 (patch) | |
tree | b86c9043f240d00cfd4a17cb4df1adff9c5c03ef /app | |
parent | a9067167bb368b1692bdd1ceea216b9215275ee2 (diff) |
Add object-fit polyfill for Edge (#4182)
Diffstat (limited to 'app')
-rw-r--r-- | app/javascript/mastodon/extra_polyfills.js | 3 | ||||
-rw-r--r-- | app/javascript/mastodon/load_polyfills.js | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/app/javascript/mastodon/extra_polyfills.js b/app/javascript/mastodon/extra_polyfills.js index 546b693b1..3acc55abd 100644 --- a/app/javascript/mastodon/extra_polyfills.js +++ b/app/javascript/mastodon/extra_polyfills.js @@ -1,2 +1,5 @@ import 'intersection-observer'; import 'requestidlecallback'; +import objectFitImages from 'object-fit-images'; + +objectFitImages(); diff --git a/app/javascript/mastodon/load_polyfills.js b/app/javascript/mastodon/load_polyfills.js index bc5468595..df7889118 100644 --- a/app/javascript/mastodon/load_polyfills.js +++ b/app/javascript/mastodon/load_polyfills.js @@ -20,11 +20,12 @@ function loadPolyfills() { ); // Latest version of Firefox and Safari do not have IntersectionObserver. - // Edge does not have requestIdleCallback. + // Edge does not have requestIdleCallback and object-fit CSS property. // This avoids shipping them all the polyfills. const needsExtraPolyfills = !( window.IntersectionObserver && - window.requestIdleCallback + window.requestIdleCallback && + 'object-fit' in (new Image()).style ); return Promise.all([ |