Fix JavaScript this for event handlers.