Last active
August 29, 2015 14:27
-
-
Save robert-blankenship/86eb2522099966035c92 to your computer and use it in GitHub Desktop.
karlkani-styles.js
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
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