Ported some event handling from RevealJS