Skip to content

Commit

Permalink
Merge pull request #6 from proll/hide-remove-selectors-all
Browse files Browse the repository at this point in the history
Hide remove selectors all
  • Loading branch information
garris committed Dec 5, 2014
2 parents a2d82d5 + 900d2f5 commit c18c86b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions capture/genBitmaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,21 @@ function capturePageSelectors(url,grabConfigs,viewports,bitmaps_reference,bitmap
//HIDE SELECTORS WE WANT TO AVOID
grabConfig.hideSelectors.forEach(function(o,i,a){
casper.evaluate(function(o){
document.querySelector(o).style.visibility='hidden';
Array.prototype.forEach.call(document.querySelectorAll(o), function(s, j){
s.style.visibility='hidden';
});
},o);
});

//REMOVE UNWANTED SELECTORS FROM RENDER TREE
grabConfig.removeSelectors.forEach(function(o,i,a){
casper.evaluate(function(o){
document.querySelector(o).style.display='none';
Array.prototype.forEach.call(document.querySelectorAll(o), function(s, j){
s.style.display='none';
});
},o);
});

//CREATE SCREEN SHOTS AND TEST COMPARE CONFIGURATION (CONFIG FILE WILL BE SAVED WHEN THIS PROCESS RETURNS)
grabConfig.selectors.forEach(function(o,i,a){
var cleanedSelectorName = o.replace(/[^a-zA-Z\d]/,'');//remove anything that's not a letter or a number
Expand Down

0 comments on commit c18c86b

Please sign in to comment.