object-fit-images
Advanced tools
Comparing version 3.0.0-0 to 3.0.1
@@ -162,3 +162,3 @@ /*! npm.im/object-fit-images */ | ||
function getOfiImageMaybe(el, name) { | ||
return el[OFI] && (name === 'src' || name === 'srcset') ? el[OFI].img : el; | ||
return el[OFI] && el[OFI].img && (name === 'src' || name === 'srcset') ? el[OFI].img : el; | ||
} | ||
@@ -186,3 +186,3 @@ if (!supportsObjectPosition) { | ||
if (typeof imgs === 'string') { | ||
imgs = document.querySelectorAll('img'); | ||
imgs = document.querySelectorAll(imgs); | ||
} else if (!('length' in imgs)) { | ||
@@ -225,2 +225,2 @@ imgs = [imgs]; | ||
module.exports = fix; | ||
module.exports = fix; |
@@ -160,3 +160,3 @@ /*! npm.im/object-fit-images */ | ||
function getOfiImageMaybe(el, name) { | ||
return el[OFI] && (name === 'src' || name === 'srcset') ? el[OFI].img : el; | ||
return el[OFI] && el[OFI].img && (name === 'src' || name === 'srcset') ? el[OFI].img : el; | ||
} | ||
@@ -184,3 +184,3 @@ if (!supportsObjectPosition) { | ||
if (typeof imgs === 'string') { | ||
imgs = document.querySelectorAll('img'); | ||
imgs = document.querySelectorAll(imgs); | ||
} else if (!('length' in imgs)) { | ||
@@ -223,2 +223,2 @@ imgs = [imgs]; | ||
export default fix; | ||
export default fix; |
{ | ||
"name": "object-fit-images", | ||
"version": "3.0.0-0", | ||
"version": "3.0.1", | ||
"description": "Polyfill object-fit and object-position on images on IE9, IE10, IE11, Edge, Safari, ...", | ||
@@ -40,3 +40,3 @@ "license": "MIT", | ||
"jsfix": "xo --fix", | ||
"watch:server": "browser-sync start --startPath demo --no-ghost-mode --reload-delay 300 --no-open --server --files 'dist/*.browser.js,demo/**'", | ||
"watch:server": "browser-sync start --startPath demo --no-ghost-mode --reload-delay 300 --no-open --server --files 'dist/*.min.js,demo/**'", | ||
"watch:build": "onchange 'index.js' --initial -- npm run build -- --continue-on-error", | ||
@@ -48,3 +48,3 @@ "watch": "npm-run-all --parallel --silent watch:*", | ||
"devDependencies": { | ||
"bfred-npm-bundler": "^7.1.2", | ||
"bfred-npm-bundler": "^8.0.1", | ||
"browser-sync": "^2.17.5", | ||
@@ -51,0 +51,0 @@ "npm-run-all": "^4.0.0", |
@@ -5,3 +5,3 @@ # object-fit-images | ||
[![gzipped size](https://badges.herokuapp.com/size/github/bfred-it/object-fit-images/master/dist/ofi.browser.js?gzip=true&label=gzipped%20size)](#readme) [![Travis build status](https://api.travis-ci.org/bfred-it/object-fit-images.svg)](https://travis-ci.org/bfred-it/object-fit-images) [![npm version](https://img.shields.io/npm/v/object-fit-images.svg)](https://www.npmjs.com/package/object-fit-images) | ||
[![gzipped size](https://badges.herokuapp.com/size/github/bfred-it/object-fit-images/master/dist/ofi.min.js?gzip=true&label=gzipped%20size)](#readme) [![Travis build status](https://api.travis-ci.org/bfred-it/object-fit-images.svg)](https://travis-ci.org/bfred-it/object-fit-images) [![npm version](https://img.shields.io/npm/v/object-fit-images.svg)](https://www.npmjs.com/package/object-fit-images) | ||
@@ -14,7 +14,7 @@ This adds support for `object-fit` and `object-position` to **IEdge 9-13, Android < 5, Safari < 10** and skips browsers that already support them. | ||
- CPU-light code | ||
- Fast and lightweight | ||
- No additional elements are created or necessary | ||
- Once set, position is taken care by the browser | ||
- You can normally get and set the `<img>`'s `src` attribute: `img.src = 'other-image.jpg'` | ||
- `srcset` support | ||
- You can still access/change `src` and `srcset` properties and attributes: `img.src = 'other-image.jpg'` | ||
@@ -73,3 +73,3 @@ ## Comparison table with alternative solutions | ||
0. the activation call before `</body>`, or _on DOM ready_ | ||
0. <a name="activation"></a> the activation call before `</body>`, or _on DOM ready_ | ||
@@ -142,3 +142,3 @@ ```js | ||
```html | ||
<script src="dist/ofi.browser.js"></script> | ||
<script src="dist/ofi.min.js"></script> | ||
``` | ||
@@ -149,3 +149,3 @@ | ||
```html | ||
<script src="https://unpkg.com/object-fit-images@VERSION/dist/ofi.browser.js"></script> | ||
<script src="https://unpkg.com/object-fit-images@VERSION/dist/ofi.min.js"></script> | ||
``` | ||
@@ -152,0 +152,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
37085
12
597
0
0