Last active
November 30, 2015 22:54
-
-
Save robert-blankenship/b01ba24de2b060b8c89f to your computer and use it in GitHub Desktop.
Hide Drawer Titles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log("Running Gist at https://gist.github.com/robert-blankenship/b01ba24de2b060b8c89f"); | |
function when(selector, callback) { | |
var interval = window.setInterval(function () { | |
if (document.querySelectorAll(selector).length > 0) { | |
callback(); | |
window.clearInterval(interval); | |
} | |
}, 200); | |
} | |
function hideElement(el) { | |
el.style.display = 'none'; | |
} | |
function hideWhenVisible(selector) { | |
when(selector, function() { | |
[].forEach.call(document.querySelectorAll(selector), hideElement); | |
}); | |
} | |
hideWhenVisible('[ng-if="categoryLinks.length"]'); | |
hideWhenVisible('.spb-drawersectiontextcolor'); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment