Skip to content

Instantly share code, notes, and snippets.

(function() {
var focusInHandler = function(e) { e.findElement().fire("focus:in") };
var focusOutHandler = function(e) { e.findElement().fire("focus:out") };
if (document.addEventListener) {
document.observe("focus", focusInHandler, true);
document.observe("blur", focusOutHandler, true);
} else {
document.observe("focusin", focusInHandler);
document.observe("focusout", focusOutHandler);