Skip to content

Commit 0a2d989

Browse files
committed
With this update you can made all your images with missing required info allow to resize with her parent container
1 parent bbc09ed commit 0a2d989

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

foresight.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
: ( !isNaN( tmpAspectRatio ) && tmpAspectRatio !== null ? parseFloat( tmpAspectRatio) : 0 );
119119

120120
// missing required info
121-
if ( !img[ DEFAULT_SRC ] || (( !img[ WIDTH_UNITS ] || !img[ HEIGHT_UNITS ] ) && !img[ ASPECT_RATIO ])) {
121+
if ( !img[ DEFAULT_SRC ] ) {
122122
img.ignore = TRUE;
123123
continue;
124124
}
@@ -287,7 +287,7 @@
287287
// ie: .fs-640x480{width:640px;height:480px}
288288
// ensure no duplicates are added to the CSS rules array
289289
dimensionCssRules[ dimensionClassName ] = TRUE;
290-
dimensionCssRules.push( '.' + dimensionClassName + '{width:' + img[ BROWSER_WIDTH ] + 'px;height:' + img[ BROWSER_HEIGHT ] + 'px}' );
290+
dimensionCssRules.push( '.' + dimensionClassName + '{width:' + ( (img[ BROWSER_WIDTH ]>0) ? (img[ BROWSER_WIDTH ] + 'px;') : 'inherit;' ) + ' height:' + ( (img[ BROWSER_HEIGHT ]>0) ? (img[ BROWSER_HEIGHT ] + 'px;') : 'auto;' ) + '}' );
291291
}
292292
}
293293

0 commit comments

Comments
 (0)