Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

object-fit-images

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

object-fit-images - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

CHANGELOG.md

13

dist/ofi.common-js.js

@@ -27,11 +27,10 @@ 'use strict';

// Edge 12 doesn't support currentSrc https://blogs.windows.com/msedgedev/2015/10/07/using-extended-srcset-and-the-picture-element-to-tailor-your-image-to-every-device-and-layout/
// Edge 12 doesn't support currentSrc
// https://github.com/bfred-it/object-fit-images/blob/gh-pages/detailed-support-tables.md#object-fit-images--srcset
src = src || el.currentSrc || el.src;
el.style.background = 'url(' + src + ') ' + (style['object-position'] || 'center') + '/' + style['object-fit'].replace('none', 'auto').replace('scale-down', 'contain') + ' no-repeat';
el.style.backgroundImage = 'url(' + src + ')';
el.style.backgroundPosition = style['object-position'] || 'center';
el.style.backgroundSize = style['object-fit'].replace('scale-down', 'contain'); // "object-fit: none" automatically maps to "background-size:auto"
el.style.backgroundRepeat = 'no-repeat';
if (!el.style.background) {
// el.style.background is invalid, don't replace the <img>
return;
}
// remove srcset because it overrides src

@@ -38,0 +37,0 @@ if (el.srcset) {

{
"name": "object-fit-images",
"version": "2.1.0",
"version": "2.2.0",
"description": "Adds support to object-fit to images on IE9, IE10, IE11, Edge and other old browsers.",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -7,3 +7,3 @@ # object-fit-images

This script was made with the main use-case in mind: images. Take a look at the [demo.](http://bfred-it.github.io/object-fit-images/demo.html)
This script was made with the most common use-case in mind: images. Take a look at the [demo.](http://bfred-it.github.io/object-fit-images/demo.html)

@@ -128,12 +128,4 @@ ## Main features

## Changelog
* 2.1.0 Further byte savings
* 2.0.0 Flipped `onresize` default: the values rarely change with media queries, so only enable them when needed with `{watchMQ:true}`
* 1.1.0 Added `srcset` support
* 1.0.0 First public release
## License
MIT © [Federico Brigante](http://twitter.com/bfred_it)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc