diff options
author | Yamagishi Kazutoshi <ykzts@desire.sh> | 2018-04-23 16:15:51 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2018-04-23 09:15:51 +0200 |
commit | 0758b00bfddf4a2c845d0d611e50717a268fd48a (patch) | |
tree | d196a207536dab549adb201b5f8201d8f38af8e1 /app/javascript/mastodon/load_polyfills.js | |
parent | 660cb058e18f8607a0044b5a89614e1caeb07ed9 (diff) |
Refactor resizeImage method (#7236)
- Use URL.createObjectURL (replace from FileReader) - Use HTMLCanvasElement.prototype.toBlob (replace from HTMLCanvasElement.prototype.toDataURL) - Use Promise (replace callback interface)
Diffstat (limited to 'app/javascript/mastodon/load_polyfills.js')
-rw-r--r-- | app/javascript/mastodon/load_polyfills.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/javascript/mastodon/load_polyfills.js b/app/javascript/mastodon/load_polyfills.js index 815e1905b..8cb81c1a6 100644 --- a/app/javascript/mastodon/load_polyfills.js +++ b/app/javascript/mastodon/load_polyfills.js @@ -12,12 +12,13 @@ function importExtraPolyfills() { function loadPolyfills() { const needsBasePolyfills = !( + Array.prototype.includes && + HTMLCanvasElement.prototype.toBlob && window.Intl && + Number.isNaN && Object.assign && Object.values && - Number.isNaN && - window.Symbol && - Array.prototype.includes + window.Symbol ); // Latest version of Firefox and Safari do not have IntersectionObserver. |