Skip to content

Instantly share code, notes, and snippets.

@robert-blankenship
Last active November 30, 2015 22:54
Show Gist options
  • Save robert-blankenship/b01ba24de2b060b8c89f to your computer and use it in GitHub Desktop.
Save robert-blankenship/b01ba24de2b060b8c89f to your computer and use it in GitHub Desktop.
Hide Drawer Titles
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