Created
August 21, 2013 18:01
-
-
Save brandonjp/6297802 to your computer and use it in GitHub Desktop.
hides the Barley editor until ESC (or whatever key you choose) is pressed 3 times in a sec
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 barleyBarHider(keyCode) { // need the keyCode? try whatthekeycode.com | |
var bb = jQuery('#barley-bar').children('#barley-logo').slideUp().end().hide(); | |
var pressCount = 0; | |
var keyCode = typeof keyCode==="number" && ~~keyCode>0 ? ~~keyCode : 27; // use ESC key if error or NaN | |
jQuery(document).keyup(function(e) { | |
if (e.keyCode == keyCode) { | |
pressCount++; | |
if (pressCount==3) bb.show().children('#barley-logo').slideDown(); | |
setTimeout(function(){pressCount=0},1000); | |
} | |
}); | |
} | |
barleyBarHider(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment