Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Commit

Permalink
Don't apply to <svg><image> (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
dartess authored and bfred-it committed May 8, 2017
1 parent 754bdf1 commit 796f761
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,15 @@ function hijackAttributes() {
export default function fix(imgs, opts) {
const startAutoMode = !autoModeEnabled && !imgs;
opts = opts || {};
imgs = imgs || 'img';

if ((supportsObjectPosition && !opts.skipTest) || !supportsOFI) {
return false;
}

// use imgs as a selector or just select all images
if (typeof imgs === 'string') {
if (!imgs) {
imgs = document.getElementsByTagName('img');
} else if (typeof imgs === 'string') {
imgs = document.querySelectorAll(imgs);
} else if (!('length' in imgs)) {
imgs = [imgs];
Expand Down

0 comments on commit 796f761

Please sign in to comment.