Skip to content

Instantly share code, notes, and snippets.

@robert-blankenship
Last active August 29, 2015 14:27
Show Gist options
  • Save robert-blankenship/86eb2522099966035c92 to your computer and use it in GitHub Desktop.
Save robert-blankenship/86eb2522099966035c92 to your computer and use it in GitHub Desktop.
karlkani-styles.js
function when(selector, callback) {
var interval = window.setInterval(function () {
if (document.querySelectorAll(selector).length > 0) {
callback();
window.clearInterval(interval);
}
}, 200);
}
when('#drawer h6', function () {
function hideElement(el) {
el.style.display = 'none';
}
hideElement(document.querySelectorAll('#drawer a[href="http://karlkani.com/?sp_desktop=1"]')[0]);
hideElement(document.querySelectorAll('#drawer h6')[1]);
});
var blogLinkSelector = '#drawer a[ng-click="drawLink(\'/page/blog\')"]';
when(blogLinkSelector, function () {
var blogLink = document.querySelectorAll(blogLinkSelector)[0];
angular.element(blogLink).unbind('click');
angular.element(blogLink).bind('click', function () {
window.location = 'http://blog.karlkani.com';
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment