Skip to content

Commit

Permalink
Fix some busted bits
Browse files Browse the repository at this point in the history
- Import find to use it
- Use new dom property to query dom
  • Loading branch information
blowery committed May 27, 2016
1 parent 0de8d2d commit bd91d61
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client/lib/feed-post-store/normalization-rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,17 @@ const fastPostNormalizationRules = [
classifyPost
];

function discoverFullBleedImages( post, callback ) {
function discoverFullBleedImages( post, dom ) {
if ( post.site_ID === DISCOVER_BLOG_ID ) {
const images = toArray( post.__contentDOM.querySelectorAll( '.fullbleed img, img.fullbleed' ) );
const images = dom.querySelectorAll( '.fullbleed img, img.fullbleed' );
forEach( images, function( image ) {
const newSrc = resizeImageUrl( image.src, { w: DISCOVER_FULL_BLEED_WIDTH } );
let oldImageObject = find( post.content_images, { src: image.src } );
oldImageObject.src = newSrc;
image.src = newSrc;
} );
}
callback();
return post;
}

/**
Expand Down
1 change: 1 addition & 0 deletions client/lib/post-normalizer/rule-wait-for-images-to-load.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
* External Dependencies
*/
import filter from 'lodash/filter';
import find from 'lodash/find';
import flow from 'lodash/flow';
import forEach from 'lodash/forEach';
import map from 'lodash/map';
Expand Down

0 comments on commit bd91d61

Please sign in to comment.